@Internal public class NettyStreamingFileUpload extends java.lang.Object implements StreamingFileUpload
StreamingFileUpload
interface for Netty.Constructor and Description |
---|
NettyStreamingFileUpload(io.netty.handler.codec.http.multipart.FileUpload httpData,
HttpServerConfiguration.MultipartConfiguration multipartConfiguration,
java.util.concurrent.ExecutorService ioExecutor,
io.reactivex.Flowable subject) |
Modifier and Type | Method and Description |
---|---|
protected java.io.File |
createTemp(java.lang.String location) |
org.reactivestreams.Publisher<java.lang.Boolean> |
delete()
Deletes the underlying storage for a file item, including deleting any associated temporary disk 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 the
FileUpload has been fully uploaded or is in a partial state. |
void |
subscribe(org.reactivestreams.Subscriber<? super PartData> s) |
org.reactivestreams.Publisher<java.lang.Boolean> |
transferTo(java.io.File destination)
A convenience method to write this uploaded item to disk.
|
org.reactivestreams.Publisher<java.lang.Boolean> |
transferTo(java.lang.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, java.util.concurrent.ExecutorService ioExecutor, io.reactivex.Flowable subject)
httpData
- The file upload (the data)multipartConfiguration
- The multipart configurationioExecutor
- The IO executorsubject
- The subjectpublic java.util.Optional<MediaType> getContentType()
FileUpload
getContentType
in interface FileUpload
public java.lang.String getName()
FileUpload
getName
in interface FileUpload
public java.lang.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 org.reactivestreams.Publisher<java.lang.Boolean> transferTo(java.lang.String location)
StreamingFileUpload
A 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 StreamingFileUpload
location
- 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 org.reactivestreams.Publisher<java.lang.Boolean> transferTo(java.io.File destination)
StreamingFileUpload
A 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 StreamingFileUpload
destination
- the destination of the file to which the stream will be written.Publisher
that outputs whether the transfer was successfulpublic org.reactivestreams.Publisher<java.lang.Boolean> delete()
StreamingFileUpload
delete
in interface StreamingFileUpload
Publisher
that outputs whether the delete was successfulprotected java.io.File createTemp(java.lang.String location)
location
- The location for the temp file