Interface FileUpload

All Known Subinterfaces:
CompletedFileUpload, StreamingFileUpload
All Known Implementing Classes:
NettyCompletedFileUpload, NettyStreamingFileUpload

@Internal public interface FileUpload

Represents a part of a MediaType.MULTIPART_FORM_DATA request.

Since:
1.0
Author:
Graeme Rocher
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Discards the contents of the file.
    Gets the content type of this part.
    long
    Returns the defined content length of the part.
    Gets the name of this part.
    Gets the name of this part.
    long
    Returns the size of the part.
    boolean
    Returns whether the FileUpload has been fully uploaded or is in a partial state.
  • Method Details

    • getContentType

      Optional<MediaType> getContentType()
      Gets the content type of this part.
      Returns:
      The content type of this part.
    • getName

      String getName()
      Gets the name of this part.
      Returns:
      The name of this part
    • getFilename

      String getFilename()
      Gets the name of this part.
      Returns:
      The name of this part
    • getSize

      long getSize()
      Returns the size of the part.
      Returns:
      The size of this part, in bytes.
    • getDefinedSize

      long getDefinedSize()
      Returns the defined content length of the part.
      Returns:
      The content length of this part, in bytes.
    • isComplete

      boolean isComplete()
      Returns whether the FileUpload has been fully uploaded or is in a partial state.
      Returns:
      True if the part is fully uploaded
    • discard

      default void discard()
      Discards the contents of the file. This must be called if the file will not be read and has not already been read. Failure to either read or discard the file will result in memory leaks!
      Since:
      2.4.0