Class NettyCompletedFileUpload
java.lang.Object
io.micronaut.http.server.netty.multipart.NettyCompletedFileUpload
- All Implemented Interfaces:
io.micronaut.http.multipart.CompletedFileUpload,io.micronaut.http.multipart.CompletedPart,io.micronaut.http.multipart.FileUpload,io.micronaut.http.multipart.PartData
@Internal
public class NettyCompletedFileUpload
extends Object
implements io.micronaut.http.multipart.CompletedFileUpload
A Netty implementation of
CompletedFileUpload.- Since:
- 1.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionNettyCompletedFileUpload(io.netty.handler.codec.http.multipart.FileUpload fileUpload) NettyCompletedFileUpload(io.netty.handler.codec.http.multipart.FileUpload fileUpload, boolean controlRelease) -
Method Summary
-
Constructor Details
-
NettyCompletedFileUpload
public NettyCompletedFileUpload(io.netty.handler.codec.http.multipart.FileUpload fileUpload) - Parameters:
fileUpload- The file upload
-
NettyCompletedFileUpload
public NettyCompletedFileUpload(io.netty.handler.codec.http.multipart.FileUpload fileUpload, boolean controlRelease) - Parameters:
fileUpload- The file uploadcontrolRelease- If true, release after retrieving the data
-
-
Method Details
-
getInputStream
Gets the content of this part as aInputStream.The contents of the file will be released when the stream is closed. This method should only be called once
- Specified by:
getInputStreamin interfaceio.micronaut.http.multipart.PartData- Returns:
- The content of this part as a
InputStream - Throws:
IOException- If an error occurs in retrieving the content
-
getBytes
Gets the content of this part as abyte[].Because the contents of the file are released after being retrieved, this method can only be called once
- Specified by:
getBytesin interfaceio.micronaut.http.multipart.PartData- Returns:
- The content of this part as a
byte[] - Throws:
IOException- If an error occurs in retrieving the content
-
getByteBuffer
Gets the content of this part as aByteBuffer.Because the contents of the file are released after being retrieved, this method can only be called once
- Specified by:
getByteBufferin interfaceio.micronaut.http.multipart.PartData- Returns:
- The content of this part as a
ByteBuffer - Throws:
IOException- If an error occurs in retrieving the content
-
getContentType
- Specified by:
getContentTypein interfaceio.micronaut.http.multipart.FileUpload- Specified by:
getContentTypein interfaceio.micronaut.http.multipart.PartData
-
getName
- Specified by:
getNamein interfaceio.micronaut.http.multipart.CompletedPart- Specified by:
getNamein interfaceio.micronaut.http.multipart.FileUpload
-
getFilename
- Specified by:
getFilenamein interfaceio.micronaut.http.multipart.FileUpload
-
getSize
public long getSize()- Specified by:
getSizein interfaceio.micronaut.http.multipart.FileUpload
-
getDefinedSize
public long getDefinedSize()- Specified by:
getDefinedSizein interfaceio.micronaut.http.multipart.FileUpload
-
isComplete
public boolean isComplete()- Specified by:
isCompletein interfaceio.micronaut.http.multipart.FileUpload
-
discard
public final void discard()- Specified by:
discardin interfaceio.micronaut.http.multipart.FileUpload
-