Interface StreamingFileUpload
-
- All Superinterfaces:
FileUpload
,org.reactivestreams.Publisher<PartData>
public interface StreamingFileUpload extends FileUpload, org.reactivestreams.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 mannerAll I/O operation return a
Publisher
that runs on the the configured I/OExecutorService
- Since:
- 1.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description org.reactivestreams.Publisher<java.lang.Boolean>
delete()
Deletes the underlying storage for a file item, including deleting any associated temporary disk file.org.reactivestreams.Publisher<java.lang.Boolean>
transferTo(java.io.File destination)
A convenience method to write this uploaded item to disk.default org.reactivestreams.Publisher<java.lang.Boolean>
transferTo(java.io.OutputStream outputStream)
A convenience method to write this uploaded item the provided output stream.org.reactivestreams.Publisher<java.lang.Boolean>
transferTo(java.lang.String location)
Deprecated.UsetransferTo(File)
ortransferTo(OutputStream)
instead.-
Methods inherited from interface io.micronaut.http.multipart.FileUpload
discard, getContentType, getDefinedSize, getFilename, getName, getSize, isComplete
-
-
-
-
Method Detail
-
transferTo
@Deprecated org.reactivestreams.Publisher<java.lang.Boolean> transferTo(java.lang.String location)
Deprecated.UsetransferTo(File)
ortransferTo(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- Parameters:
location
- the name of the file to which the stream will be written. The file is created relative to the location as specified in theMultipartConfiguration
- Returns:
- A
Publisher
that outputs whether the transfer was successful
-
transferTo
org.reactivestreams.Publisher<java.lang.Boolean> transferTo(java.io.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- Parameters:
destination
- the destination of the file to which the stream will be written.- Returns:
- A
Publisher
that outputs whether the transfer was successful
-
transferTo
default org.reactivestreams.Publisher<java.lang.Boolean> transferTo(java.io.OutputStream outputStream)
A convenience method to write this uploaded item the provided output stream.
- Parameters:
outputStream
- the destination to which the stream will be written.- Returns:
- A
Publisher
that outputs whether the transfer was successful - Since:
- 3.1.0
-
delete
org.reactivestreams.Publisher<java.lang.Boolean> delete()
Deletes the underlying storage for a file item, including deleting any associated temporary disk file.- Returns:
- A
Publisher
that outputs whether the delete was successful
-
-