Package io.micronaut.http.multipart
Interface FileUpload
-
- All Known Subinterfaces:
CompletedFileUpload
,StreamingFileUpload
@Internal public interface FileUpload
Represents a part of a
MediaType.MULTIPART_FORM_DATA
request.- Since:
- 1.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
discard()
Discards the contents of the file.java.util.Optional<MediaType>
getContentType()
Gets the content type of this part.long
getDefinedSize()
Returns the defined content length of the part.java.lang.String
getFilename()
Gets the name of this part.java.lang.String
getName()
Gets the name of this part.long
getSize()
Returns the size of the part.boolean
isComplete()
Returns whether theFileUpload
has been fully uploaded or is in a partial state.
-
-
-
Method Detail
-
getContentType
java.util.Optional<MediaType> getContentType()
Gets the content type of this part.- Returns:
- The content type of this part.
-
getName
java.lang.String getName()
Gets the name of this part.- Returns:
- The name of this part
-
getFilename
java.lang.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 theFileUpload
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
-
-