Class HttpServerFileUpload

java.lang.Object
io.vertx.mutiny.core.http.HttpServerFileUpload
All Implemented Interfaces:
MutinyDelegate, ReadStream<Buffer>, StreamBase

public class HttpServerFileUpload extends Object implements MutinyDelegate, ReadStream<Buffer>
Represents an file upload from an HTML FORM.

NOTE: This class has been automatically generated from the original non Mutiny-ified interface using Vert.x codegen.

  • Field Details

  • Constructor Details

    • HttpServerFileUpload

      public HttpServerFileUpload(io.vertx.core.http.HttpServerFileUpload delegate)
    • HttpServerFileUpload

      public HttpServerFileUpload(Object delegate)
  • Method Details

    • getDelegate

      public io.vertx.core.http.HttpServerFileUpload getDelegate()
      Specified by:
      getDelegate in interface MutinyDelegate
      Specified by:
      getDelegate in interface ReadStream<Buffer>
      Specified by:
      getDelegate in interface StreamBase
      Returns:
      the delegate used by this Mutiny object of generated type
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • pipe

      public Pipe<Buffer> pipe()
      Specified by:
      pipe in interface ReadStream<Buffer>
      Returns:
      a pipe
    • pipeTo

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> pipeTo(WriteStream<Buffer> dst)
      Pipe this ReadStream to the WriteStream.

      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 interface ReadStream<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 of ReadStream.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 interface ReadStream<Buffer>
      Parameters:
      dst - the destination write stream
      Returns:
      the Void instance produced by the operation.
    • pipeToAndForget

      public void pipeToAndForget(WriteStream<Buffer> dst)
      Variant of ReadStream.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 from ReadStream.pipeTo(io.vertx.mutiny.core.streams.WriteStream) but you don't need to compose it with other operations.

      Specified by:
      pipeToAndForget in interface ReadStream<Buffer>
      Parameters:
      dst - the destination write stream
    • exceptionHandler

      public HttpServerFileUpload exceptionHandler(Consumer<Throwable> handler)
      Specified by:
      exceptionHandler in interface ReadStream<Buffer>
      Specified by:
      exceptionHandler in interface StreamBase
      Parameters:
      handler - the exception handler
      Returns:
    • handler

      public HttpServerFileUpload handler(Consumer<Buffer> handler)
      Specified by:
      handler in interface ReadStream<Buffer>
      Returns:
    • endHandler

      public HttpServerFileUpload endHandler(Runnable endHandler)
      Specified by:
      endHandler in interface ReadStream<Buffer>
      Returns:
    • pause

      public HttpServerFileUpload pause()
      Specified by:
      pause in interface ReadStream<Buffer>
      Returns:
      a reference to this, so the API can be used fluently
    • resume

      public HttpServerFileUpload resume()
      Specified by:
      resume in interface ReadStream<Buffer>
      Returns:
      a reference to this, so the API can be used fluently
    • fetch

      public HttpServerFileUpload fetch(long amount)
      Specified by:
      fetch in interface ReadStream<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 of streamToFileSystem(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 of streamToFileSystem(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 from streamToFileSystem(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 via size().
    • 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 interface ReadStream<Buffer>
    • toBlockingIterable

      public Iterable<Buffer> toBlockingIterable()
    • toBlockingStream

      public Stream<Buffer> toBlockingStream()
    • newInstance

      public static HttpServerFileUpload newInstance(io.vertx.core.http.HttpServerFileUpload arg)