public interface HttpServerFileUpload extends ReadStream<Buffer>
Modifier and Type | Method and Description |
---|---|
boolean |
cancelStreamToFileSystem()
Try to cancel the file system streaming, the streamed file will be deleted.
|
String |
charset() |
String |
contentTransferEncoding() |
String |
contentType() |
HttpServerFileUpload |
endHandler(Handler<Void> endHandler)
Set an end handler.
|
HttpServerFileUpload |
exceptionHandler(Handler<Throwable> handler)
Set an exception handler on the read stream.
|
HttpServerFileUpload |
fetch(long amount)
Fetch the specified
amount of elements. |
AsyncFile |
file() |
String |
filename() |
HttpServerFileUpload |
handler(Handler<Buffer> handler)
Set a data handler.
|
boolean |
isSizeAvailable() |
String |
name() |
HttpServerFileUpload |
pause()
Pause the
ReadStream , it sets the buffer in fetch mode and clears the actual demand. |
HttpServerFileUpload |
resume()
Resume reading, and sets the buffer in
flowing mode. |
long |
size()
The size of the upload may not be available until it is all read.
|
Future<Void> |
streamToFileSystem(String filename)
Stream the content of this upload to the given file on storage.
|
void |
streamToFileSystem(String filename,
Handler<AsyncResult<Void>> handler)
Stream the content of this upload to the given file on storage.
|
pipe, pipeTo, pipeTo
HttpServerFileUpload exceptionHandler(Handler<Throwable> handler)
ReadStream
exceptionHandler
in interface ReadStream<Buffer>
exceptionHandler
in interface StreamBase
handler
- the exception handlerHttpServerFileUpload handler(Handler<Buffer> handler)
ReadStream
handler
in interface ReadStream<Buffer>
HttpServerFileUpload endHandler(Handler<Void> endHandler)
ReadStream
endHandler
in interface ReadStream<Buffer>
HttpServerFileUpload pause()
ReadStream
ReadStream
, it sets the buffer in fetch
mode and clears the actual demand.
While it's paused, no data will be sent to the data handler
.
pause
in interface ReadStream<Buffer>
HttpServerFileUpload resume()
ReadStream
flowing
mode.
If the ReadStream
has been paused, reading will recommence on it.resume
in interface ReadStream<Buffer>
HttpServerFileUpload fetch(long amount)
ReadStream
amount
of elements. If the ReadStream
has been paused, reading will
recommence with the specified amount
of items, otherwise the specified amount
will
be added to the current stream demand.fetch
in interface ReadStream<Buffer>
void streamToFileSystem(String filename, Handler<AsyncResult<Void>> handler)
filename
- the name of the fileFuture<Void> streamToFileSystem(String filename)
If the stream has a failure or is cancelled the created file will be deleted.
filename
- the name of the fileboolean cancelStreamToFileSystem() throws IllegalStateException
true
when the stream is cancelled, otherwise it means that stream is finishedIllegalStateException
- when no stream is in progressString filename()
String name()
String contentType()
String contentTransferEncoding()
String charset()
long size()
isSizeAvailable()
to determine thisboolean isSizeAvailable()
true
if the size of the upload can be retrieved via size()
.AsyncFile file()
streamToFileSystem(java.lang.String, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)
has been used and the file is availableCopyright © 2024 Eclipse. All rights reserved.