Package io.micronaut.http.multipart
Interface FileUpload
- All Known Subinterfaces:
CompletedFileUpload
,StreamingFileUpload
- All Known Implementing Classes:
NettyCompletedFileUpload
,NettyStreamingFileUpload
Represents a part of a MediaType.MULTIPART_FORM_DATA
request.
- Since:
- 1.0
- Author:
- Graeme Rocher
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
discard()
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.getName()
Gets the name of this part.long
getSize()
Returns the size of the part.boolean
Returns whether theFileUpload
has been fully uploaded or is in a partial state.
-
Method Details
-
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 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
-