Class HttpServerFileUpload
- All Implemented Interfaces:
MutinyDelegate,ReadStream<io.vertx.core.buffer.Buffer>,StreamBase
NOTE: This class has been automatically generated from the original non Mutiny-ified interface.
- Author:
- Norman Maurer
- See Also:
-
HttpServerFileUpload
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.vertx.mutiny.core.streams.ReadStream
ReadStream.ReadStreamImpl<T>Nested classes/interfaces inherited from interface io.vertx.mutiny.core.streams.StreamBase
StreamBase.StreamBaseImpl -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionHttpServerFileUpload(io.vertx.core.http.HttpServerFileUpload delegate) Create a new instance ofHttpServerFileUploaddelegating to the given (non-null) instance ofHttpServerFileUpload.HttpServerFileUpload(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionbooleanTry to cancel the file system streaming, the streamed file will be deleted.charset()endHandler(Runnable endHandler) Set an end handler.booleanexceptionHandler(Consumer<Throwable> handler) Set an exception handler on the read stream.fetch(long amount) Fetch the specifiedamountof elements.file()filename()io.vertx.core.http.HttpServerFileUploadGet the delegate instance.Set a data handler.inthashCode()booleanname()static HttpServerFileUploadnewInstance(io.vertx.core.http.HttpServerFileUpload delegate) Creates a new instance of theHttpServerFileUpload.pause()Pause theReadStream, it sets the buffer infetchmode and clears the actual demand.Pipe<io.vertx.core.buffer.Buffer>pipe()Pause this stream and return aPipeto transfer the elements of this stream to a destinationWriteStream.io.smallrye.mutiny.Uni<Void>pipeTo(WriteStream<io.vertx.core.buffer.Buffer> arg0) Pipe thisReadStreamto theWriteStream.voidpipeToAndAwait(WriteStream<io.vertx.core.buffer.Buffer> arg0) Pipe thisReadStreamto theWriteStream.pipeToAndForget(WriteStream<io.vertx.core.buffer.Buffer> arg0) Pipe thisReadStreamto theWriteStream.resume()Resume reading, and sets the buffer inflowingmode.longsize()The size of the upload may not be available until it is all read.io.smallrye.mutiny.Uni<Void>streamToFileSystem(String filename) Stream the content of this upload to the given file on storage.voidstreamToFileSystemAndAwait(String filename) Stream the content of this upload to the given file on storage.streamToFileSystemAndForget(String filename) Stream the content of this upload to the given file on storage.Iterable<io.vertx.core.buffer.Buffer>Stream<io.vertx.core.buffer.Buffer>io.smallrye.mutiny.Multi<io.vertx.core.buffer.Buffer>toMulti()toString()
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
HttpServerFileUpload
public HttpServerFileUpload(io.vertx.core.http.HttpServerFileUpload delegate) Create a new instance ofHttpServerFileUploaddelegating to the given (non-null) instance ofHttpServerFileUpload. -
HttpServerFileUpload
-
-
Method Details
-
getDelegate
public io.vertx.core.http.HttpServerFileUpload getDelegate()Get the delegate instance.This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.
- Specified by:
getDelegatein interfaceMutinyDelegate- Specified by:
getDelegatein interfaceReadStream<io.vertx.core.buffer.Buffer>- Specified by:
getDelegatein interfaceStreamBase- Returns:
- the delegate instance
-
streamToFileSystem
Stream the content of this upload to the given file on storage.If the stream has a failure or is cancelled the created file will be deleted.
Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
filename- the name of the file- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
HttpServerFileUpload.streamToFileSystem(String)
-
streamToFileSystemAndAwait
Stream the content of this upload to the given file on storage.If the stream has a failure or is cancelled the created file will be deleted.
Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely 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 aRuntimeException).- Parameters:
filename- the name of the file- See Also:
-
HttpServerFileUpload.streamToFileSystem(String)
-
streamToFileSystemAndForget
Stream the content of this upload to the given file on storage.If the stream has a failure or is cancelled the created file will be deleted.
Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Parameters:
filename- the name of the file- Returns:
- The current instance to chain operations if needed.
- See Also:
-
HttpServerFileUpload.streamToFileSystem(String)
-
pipeTo
@CheckReturnValue public io.smallrye.mutiny.Uni<Void> pipeTo(WriteStream<io.vertx.core.buffer.Buffer> arg0) Pipe thisReadStreamto theWriteStream.Elements emitted by this stream will be written to the write stream until this stream ends or fails.
Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Specified by:
pipeToin interfaceReadStream<io.vertx.core.buffer.Buffer>- Parameters:
dst- the destination write stream- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
io.vertx.core.http.HttpServerFileUpload#pipeTo(WriteStream)
-
pipeToAndAwait
Pipe thisReadStreamto theWriteStream.Elements emitted by this stream will be written to the write stream until this stream ends or fails.
Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely 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 aRuntimeException).- Parameters:
dst- the destination write stream- See Also:
-
io.vertx.core.http.HttpServerFileUpload#pipeTo(WriteStream)
-
pipeToAndForget
Pipe thisReadStreamto theWriteStream.Elements emitted by this stream will be written to the write stream until this stream ends or fails.
Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Parameters:
dst- the destination write stream- Returns:
- The current instance to chain operations if needed.
- See Also:
-
io.vertx.core.http.HttpServerFileUpload#pipeTo(WriteStream)
-
exceptionHandler
Description copied from interface:ReadStreamSet an exception handler on the read stream.- Specified by:
exceptionHandlerin interfaceReadStream<io.vertx.core.buffer.Buffer>- Specified by:
exceptionHandlerin interfaceStreamBase- Parameters:
handler- the exception handler. Can benull.- Returns:
- a reference to this, so the API can be used fluently
-
handler
Description copied from interface:ReadStreamSet a data handler. As data is read, the handler will be called with the data.- Specified by:
handlerin interfaceReadStream<io.vertx.core.buffer.Buffer>- Returns:
- a reference to this, so the API can be used fluently
-
endHandler
Description copied from interface:ReadStreamSet an end handler. Once the stream has ended, and there is no more data to be read, this handler will be called.- Specified by:
endHandlerin interfaceReadStream<io.vertx.core.buffer.Buffer>- Returns:
- a reference to this, so the API can be used fluently
-
pause
Description copied from interface:ReadStreamPause theReadStream, it sets the buffer infetchmode and clears the actual demand.While it's paused, no data will be sent to the data
handler.- Specified by:
pausein interfaceReadStream<io.vertx.core.buffer.Buffer>- Returns:
- a reference to this, so the API can be used fluently
-
resume
Description copied from interface:ReadStreamResume reading, and sets the buffer inflowingmode. If theReadStreamhas been paused, reading will recommence on it.- Specified by:
resumein interfaceReadStream<io.vertx.core.buffer.Buffer>- Returns:
- a reference to this, so the API can be used fluently
-
fetch
Description copied from interface:ReadStreamFetch the specifiedamountof elements. If theReadStreamhas been paused, reading will recommence with the specifiedamountof items, otherwise the specifiedamountwill be added to the current stream demand.- Specified by:
fetchin interfaceReadStream<io.vertx.core.buffer.Buffer>- Returns:
- a reference to this, so the API can be used fluently
-
cancelStreamToFileSystem
Try to cancel the file system streaming, the streamed file will be deleted.- Returns:
truewhen the stream is cancelled, otherwise it means that stream is finished- Throws:
when- no stream is in progressIllegalStateException
-
filename
- Returns:
- the filename which was used when upload the file.
-
name
- Returns:
- the name of the attribute
-
contentType
- Returns:
- the content type for the upload
-
contentTransferEncoding
- Returns:
- the contentTransferEncoding for the upload
-
charset
- Returns:
- the charset for the upload
-
size
public long size()The size of the upload may not be available until it is all read. CheckisSizeAvailable()to determine this- Returns:
- the size of the upload (in bytes)
-
isSizeAvailable
public boolean isSizeAvailable()- Returns:
trueif the size of the upload can be retrieved viasize().
-
file
- Returns:
- the async uploaded file when
streamToFileSystem(java.lang.String)has been used and the file is available
-
pipe
Pause this stream and return aPipeto transfer the elements of this stream to a destinationWriteStream. The stream will be resumed when the pipe will be wired to aWriteStream.- Specified by:
pipein interfaceReadStream<io.vertx.core.buffer.Buffer>- Returns:
- a pipe
-
newInstance
Creates a new instance of theHttpServerFileUpload. -
hashCode
public int hashCode() -
equals
-
toString
-
toMulti
@CheckReturnValue public io.smallrye.mutiny.Multi<io.vertx.core.buffer.Buffer> toMulti() -
toBlockingIterable
-
toBlockingStream
-