public interface StreamingFileUpload extends FileUpload, Publisher<PartData>
Represents a part of a MediaType.MULTIPART_FORM_DATA
request.
The StreamingFileUpload
may be incomplete when first received, in which case the consumer can subscribe
to the file upload to process the data a chunk at a time.
The transferTo(String)
method can be used whether the upload is complete or not. If it is not complete
the framework will automatically subscribe to the upload and transfer the data chunk by chunk in a non-blocking
manner
All I/O operation return a Publisher
that runs on the the configured I/O
ExecutorService
Modifier and Type | Method and Description |
---|---|
Publisher<Boolean> |
delete()
Deletes the underlying storage for a file item, including deleting any associated temporary disk file.
|
Publisher<Boolean> |
transferTo(File destination)
A convenience method to write this uploaded item to disk.
|
default Publisher<Boolean> |
transferTo(OutputStream outputStream)
A convenience method to write this uploaded item the provided output stream.
|
Publisher<Boolean> |
transferTo(String location)
Deprecated.
Use
transferTo(File) or transferTo(OutputStream) instead. |
discard, getContentType, getDefinedSize, getFilename, getName, getSize, isComplete
@Deprecated Publisher<Boolean> transferTo(String location)
transferTo(File)
or transferTo(OutputStream)
instead.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
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 MultipartConfiguration
Publisher
that outputs whether the transfer was successfulPublisher<Boolean> transferTo(File destination)
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
destination
- the destination of the file to which the stream will be written.Publisher
that outputs whether the transfer was successfuldefault Publisher<Boolean> transferTo(OutputStream outputStream)
A convenience method to write this uploaded item the provided output stream.
outputStream
- the destination to which the stream will be written.Publisher
that outputs whether the transfer was successful