Class HttpServerFileUpload
- java.lang.Object
-
- io.vertx.mutiny.core.http.HttpServerFileUpload
-
- All Implemented Interfaces:
ReadStream<Buffer>
,StreamBase
public class HttpServerFileUpload extends Object implements ReadStream<Buffer>
Represents an file upload from an HTML FORM. NOTE: This class has been automatically generated from theoriginal
non Mutiny-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<HttpServerFileUpload>
__TYPE_ARG
-
Constructor Summary
Constructors Constructor Description HttpServerFileUpload(io.vertx.core.http.HttpServerFileUpload delegate)
HttpServerFileUpload(Object delegate)
-
Method Summary
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<HttpServerFileUpload> __TYPE_ARG
-
-
Constructor Detail
-
HttpServerFileUpload
public HttpServerFileUpload(io.vertx.core.http.HttpServerFileUpload delegate)
-
HttpServerFileUpload
public HttpServerFileUpload(Object delegate)
-
-
Method Detail
-
getDelegate
public io.vertx.core.http.HttpServerFileUpload getDelegate()
- Specified by:
getDelegate
in interfaceReadStream<Buffer>
- Specified by:
getDelegate
in interfaceStreamBase
-
pipe
public Pipe<Buffer> pipe()
- Specified by:
pipe
in interfaceReadStream<Buffer>
- Returns:
- a pipe
-
pipeTo
@CheckReturnValue public io.smallrye.mutiny.Uni<Void> pipeTo(WriteStream<Buffer> dst)
Pipe thisReadStream
to theWriteStream
.Elements emitted by this stream will be written to the write stream until this stream ends or fails.
Once this stream has ended or failed, the write stream will be ended and the
handler
will be called with the result.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Specified by:
pipeTo
in interfaceReadStream<Buffer>
- Parameters:
dst
- the destination write stream- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
pipeToAndAwait
public Void pipeToAndAwait(WriteStream<Buffer> dst)
Blocking variant ofReadStream.pipeTo(io.vertx.mutiny.core.streams.WriteStream)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Specified by:
pipeToAndAwait
in interfaceReadStream<Buffer>
- Parameters:
dst
- the destination write stream- Returns:
- the Void instance produced by the operation.
-
pipeToAndForget
public void pipeToAndForget(WriteStream<Buffer> dst)
Variant ofReadStream.pipeTo(io.vertx.mutiny.core.streams.WriteStream)
that ignores the result of the operation.This method subscribes on the result of
ReadStream.pipeTo(io.vertx.mutiny.core.streams.WriteStream)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromReadStream.pipeTo(io.vertx.mutiny.core.streams.WriteStream)
but you don't need to compose it with other operations.- Specified by:
pipeToAndForget
in interfaceReadStream<Buffer>
- Parameters:
dst
- the destination write stream
-
exceptionHandler
public HttpServerFileUpload exceptionHandler(Consumer<Throwable> handler)
- Specified by:
exceptionHandler
in interfaceReadStream<Buffer>
- Specified by:
exceptionHandler
in interfaceStreamBase
- Parameters:
handler
- the exception handler- Returns:
-
handler
public HttpServerFileUpload handler(Consumer<Buffer> handler)
- Specified by:
handler
in interfaceReadStream<Buffer>
- Returns:
-
endHandler
public HttpServerFileUpload endHandler(Runnable endHandler)
- Specified by:
endHandler
in interfaceReadStream<Buffer>
- Returns:
-
pause
public HttpServerFileUpload pause()
- Specified by:
pause
in interfaceReadStream<Buffer>
- Returns:
- a reference to this, so the API can be used fluently
-
resume
public HttpServerFileUpload resume()
- Specified by:
resume
in interfaceReadStream<Buffer>
- Returns:
- a reference to this, so the API can be used fluently
-
fetch
public HttpServerFileUpload fetch(long amount)
- Specified by:
fetch
in interfaceReadStream<Buffer>
- Returns:
- a reference to this, so the API can be used fluently
-
streamToFileSystem
@CheckReturnValue public io.smallrye.mutiny.Uni<Void> streamToFileSystem(String filename)
Stream the content of this upload to the given file on storage.Unlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
filename
- the name of the file- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
streamToFileSystemAndAwait
public Void streamToFileSystemAndAwait(String filename)
Blocking variant ofstreamToFileSystem(String)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
filename
- the name of the file- Returns:
- the Void instance produced by the operation.
-
streamToFileSystemAndForget
public void streamToFileSystemAndForget(String filename)
Variant ofstreamToFileSystem(String)
that ignores the result of the operation.This method subscribes on the result of
streamToFileSystem(String)
, but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromstreamToFileSystem(String)
but you don't need to compose it with other operations.- Parameters:
filename
- the name of the file
-
cancelStreamToFileSystem
public boolean cancelStreamToFileSystem()
- Returns:
true
when the stream is cancelled, otherwise it means that stream is finished
-
filename
public String filename()
- Returns:
- the filename which was used when upload the file.
-
name
public String name()
- Returns:
- the name of the attribute
-
contentType
public String contentType()
- Returns:
- the content type for the upload
-
contentTransferEncoding
public String contentTransferEncoding()
- Returns:
- the contentTransferEncoding for the upload
-
charset
public String charset()
- Returns:
- the charset for the upload
-
size
public long size()
- Returns:
- the size of the upload (in bytes)
-
isSizeAvailable
public boolean isSizeAvailable()
- Returns:
true
if the size of the upload can be retrieved viasize()
.
-
file
public AsyncFile file()
- Returns:
- the async uploaded file when
streamToFileSystem(java.lang.String)
has been used and the file is available
-
toMulti
@CheckReturnValue public io.smallrye.mutiny.Multi<Buffer> toMulti()
- Specified by:
toMulti
in interfaceReadStream<Buffer>
-
newInstance
public static HttpServerFileUpload newInstance(io.vertx.core.http.HttpServerFileUpload arg)
-
-