Class 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 the original non Mutiny-ified interface using Vert.x codegen.

    • Constructor Detail

      • HttpServerFileUpload

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

        public HttpServerFileUpload​(Object delegate)
    • Method Detail

      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • 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.
      • 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().
      • toBlockingStream

        public Stream<Buffer> toBlockingStream()
      • newInstance

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