@Internal public class NettyStreamingFileUpload extends Object implements StreamingFileUpload
StreamingFileUpload interface for Netty.| Constructor and Description |
|---|
NettyStreamingFileUpload(io.netty.handler.codec.http.multipart.FileUpload httpData,
HttpServerConfiguration.MultipartConfiguration multipartConfiguration,
ExecutorService ioExecutor,
io.reactivex.Flowable subject) |
| Modifier and Type | Method and Description |
|---|---|
protected File |
createTemp(String location) |
Publisher<Boolean> |
delete()
Deletes the underlying storage for a file item, including deleting any associated temporary disk file.
|
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.
|
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. |
void |
subscribe(Subscriber<? super PartData> s) |
Publisher<Boolean> |
transferTo(File destination)
A convenience method to write this uploaded item to disk.
|
Publisher<Boolean> |
transferTo(String location)
A convenience method to write this uploaded item to disk.
|
public NettyStreamingFileUpload(io.netty.handler.codec.http.multipart.FileUpload httpData,
HttpServerConfiguration.MultipartConfiguration multipartConfiguration,
ExecutorService ioExecutor,
io.reactivex.Flowable subject)
httpData - The file upload (the data)multipartConfiguration - The multipart configurationioExecutor - The IO executorsubject - The subjectpublic Optional<MediaType> getContentType()
FileUploadgetContentType in interface FileUploadpublic String getName()
FileUploadgetName in interface FileUploadpublic String getFilename()
FileUploadgetFilename in interface FileUploadpublic long getSize()
FileUploadgetSize in interface FileUploadpublic long getDefinedSize()
FileUploadgetDefinedSize in interface FileUploadpublic boolean isComplete()
FileUploadFileUpload has been fully uploaded or is in a partial state.isComplete in interface FileUploadpublic Publisher<Boolean> transferTo(String location)
StreamingFileUploadA convenience method to write this uploaded item to disk.
This method will return a no-op Publisher if called multiple times for the same location
transferTo in interface StreamingFileUploadlocation - the name of the file to which the stream will be written. The file is created relative to
the location as specified in the MultipartConfigurationPublisher that outputs whether the transfer was successfulpublic Publisher<Boolean> transferTo(File destination)
StreamingFileUploadA convenience method to write this uploaded item to disk.
This method will return a no-op Publisher if called multiple times for the same location
transferTo in interface StreamingFileUploaddestination - the destination of the file to which the stream will be written.Publisher that outputs whether the transfer was successfulpublic Publisher<Boolean> delete()
StreamingFileUploaddelete in interface StreamingFileUploadPublisher that outputs whether the delete was successfulprotected File createTemp(String location)
location - The location for the temp filepublic void subscribe(Subscriber<? super PartData> s)