@Internal public class NettyCompletedFileUpload extends Object implements CompletedFileUpload
CompletedFileUpload
.Constructor and Description |
---|
NettyCompletedFileUpload(io.netty.handler.codec.http.multipart.FileUpload fileUpload) |
NettyCompletedFileUpload(io.netty.handler.codec.http.multipart.FileUpload fileUpload,
boolean controlRelease) |
Modifier and Type | Method and Description |
---|---|
void |
discard()
Discards the contents of the file.
|
ByteBuffer |
getByteBuffer()
Gets the content of this part as a
ByteBuffer . |
byte[] |
getBytes()
Gets the content of this part as a
byte[] . |
Optional<MediaType> |
getContentType()
Gets the content type of this part.
|
long |
getDefinedSize()
Returns the defined content length of the part.
|
String |
getFilename()
Gets the name of this part.
|
InputStream |
getInputStream()
Gets the content of this part as a
InputStream . |
String |
getName()
Gets the name of this part.
|
long |
getSize()
Returns the size of the part.
|
boolean |
isComplete()
Returns whether the
FileUpload has been fully uploaded or is in a partial state. |
public NettyCompletedFileUpload(io.netty.handler.codec.http.multipart.FileUpload fileUpload)
fileUpload
- The file uploadpublic NettyCompletedFileUpload(io.netty.handler.codec.http.multipart.FileUpload fileUpload, boolean controlRelease)
fileUpload
- The file uploadcontrolRelease
- If true, release after retrieving the datapublic InputStream getInputStream() throws IOException
InputStream
.
The contents of the file will be released when the stream is closed. This method should only be called once
getInputStream
in interface PartData
InputStream
IOException
- If an error occurs in retrieving the contentpublic byte[] getBytes() throws IOException
byte[]
.
Because the contents of the file are released after being retrieved, this method can only be called once
getBytes
in interface PartData
byte[]
IOException
- If an error occurs in retrieving the contentpublic ByteBuffer getByteBuffer() throws IOException
ByteBuffer
.
Because the contents of the file are released after being retrieved, this method can only be called once
getByteBuffer
in interface PartData
ByteBuffer
IOException
- If an error occurs in retrieving the contentpublic Optional<MediaType> getContentType()
FileUpload
getContentType
in interface FileUpload
getContentType
in interface PartData
public String getName()
FileUpload
getName
in interface CompletedPart
getName
in interface FileUpload
public String getFilename()
FileUpload
getFilename
in interface FileUpload
public long getSize()
FileUpload
getSize
in interface FileUpload
public long getDefinedSize()
FileUpload
getDefinedSize
in interface FileUpload
public boolean isComplete()
FileUpload
FileUpload
has been fully uploaded or is in a partial state.isComplete
in interface FileUpload
public final void discard()
FileUpload
discard
in interface FileUpload