Class List Method List File List

# Class: Vertx::HttpServerFileUpload

Inherits:
  Object
  - Object
  - Vertx::HttpServerFileUpload
  show all
Includes:
  ReadStream
Defined in:
  /Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/http_server_file_upload.rb

## Overview

Represents an file upload from an HTML FORM.

## Instance Method Summary (collapse)

- - (String) charset
  @return the charset for the upload.
- - (String) content_transfer_encoding
  @return the contentTransferEncoding for the upload.
- - (String) content_type
  @return the content type for the upload.
- - (self) end_handler { ... }
- - (self) exception_handler { ... }
- - (String) filename
  @return the filename which was used when upload the file.
- - (self) handler { ... }
- - (String) name
  @return the name of the attribute.
- - (self) pause
- - (self) resume
- - (Fixnum) size
  The size of the upload may not be available until it is all read.
- - (true, false) size_available?
  @return true if the size of the upload can be retrieved via #size.
- - (self) stream_to_file_system(filename = nil)
  Stream the content of this upload to the given file on storage.

## Instance Method Details

### - (`String`) charset

@return the charset for the upload

Returns:

- (`String`)

Raises:

- (`ArgumentError`)

    106
    107
    108
    109
    110
    111
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/http_server_file_upload.rb', line 106

    def charset
      if !block_given?
        return @j_del.java_method(:charset, []).call()
      end
      raise ArgumentError, "Invalid arguments when calling charset()"
    end

### - (`String`) content_transfer_encoding

@return the contentTransferEncoding for the upload

Returns:

- (`String`)

Raises:

- (`ArgumentError`)

    98
    99
    100
    101
    102
    103
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/http_server_file_upload.rb', line 98

    def content_transfer_encoding
      if !block_given?
        return @j_del.java_method(:contentTransferEncoding, []).call()
      end
      raise ArgumentError, "Invalid arguments when calling content_transfer_encoding()"
    end

### - (`String`) content_type

@return the content type for the upload

Returns:

- (`String`)

Raises:

- (`ArgumentError`)

    90
    91
    92
    93
    94
    95
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/http_server_file_upload.rb', line 90

    def content_type
      if !block_given?
        return @j_del.java_method(:contentType, []).call()
      end
      raise ArgumentError, "Invalid arguments when calling content_type()"
    end

### - (`self`) end_handler { ... }

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    39
    40
    41
    42
    43
    44
    45
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/http_server_file_upload.rb', line 39

    def end_handler
      if block_given?
        @j_del.java_method(:endHandler, [Java::IoVertxCore::Handler.java_class]).call(Proc.new { yield })
        return self
      end
      raise ArgumentError, "Invalid arguments when calling end_handler()"
    end

### - (`self`) exception_handler { ... }

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    21
    22
    23
    24
    25
    26
    27
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/http_server_file_upload.rb', line 21

    def exception_handler
      if block_given?
        @j_del.java_method(:exceptionHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.from_throwable(event)) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling exception_handler()"
    end

### - (`String`) filename

@return the filename which was used when upload the file.

Returns:

- (`String`)

Raises:

- (`ArgumentError`)

    74
    75
    76
    77
    78
    79
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/http_server_file_upload.rb', line 74

    def filename
      if !block_given?
        return @j_del.java_method(:filename, []).call()
      end
      raise ArgumentError, "Invalid arguments when calling filename()"
    end

### - (`self`) handler { ... }

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    30
    31
    32
    33
    34
    35
    36
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/http_server_file_upload.rb', line 30

    def handler
      if block_given?
        @j_del.java_method(:handler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.safe_create(event,::Vertx::Buffer)) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling handler()"
    end

### - (`String`) name

@return the name of the attribute

Returns:

- (`String`)

Raises:

- (`ArgumentError`)

    82
    83
    84
    85
    86
    87
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/http_server_file_upload.rb', line 82

    def name
      if !block_given?
        return @j_del.java_method(:name, []).call()
      end
      raise ArgumentError, "Invalid arguments when calling name()"
    end

### - (`self`) pause

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    47
    48
    49
    50
    51
    52
    53
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/http_server_file_upload.rb', line 47

    def pause
      if !block_given?
        @j_del.java_method(:pause, []).call()
        return self
      end
      raise ArgumentError, "Invalid arguments when calling pause()"
    end

### - (`self`) resume

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    55
    56
    57
    58
    59
    60
    61
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/http_server_file_upload.rb', line 55

    def resume
      if !block_given?
        @j_del.java_method(:resume, []).call()
        return self
      end
      raise ArgumentError, "Invalid arguments when calling resume()"
    end

### - (`Fixnum`) size

The size of the upload may not be available until it is all read. Check #is_size_available to determine this

Returns:

- (`Fixnum`) —
  the size of the upload (in bytes)

Raises:

- (`ArgumentError`)

    115
    116
    117
    118
    119
    120
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/http_server_file_upload.rb', line 115

    def size
      if !block_given?
        return @j_del.java_method(:size, []).call()
      end
      raise ArgumentError, "Invalid arguments when calling size()"
    end

### - (`true`, `false`) size_available?

@return true if the size of the upload can be retrieved via #size.

Returns:

- (`true`, `false`)

Raises:

- (`ArgumentError`)

    123
    124
    125
    126
    127
    128
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/http_server_file_upload.rb', line 123

    def size_available?
      if !block_given?
        return @j_del.java_method(:isSizeAvailable, []).call()
      end
      raise ArgumentError, "Invalid arguments when calling size_available?()"
    end

### - (`self`) stream_to_file_system(filename = nil)

Stream the content of this upload to the given file on storage.

Parameters:

- filename (`String`) (defaults to: `nil`) —
  the name of the file

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    65
    66
    67
    68
    69
    70
    71
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/src/main/resources/vertx/http_server_file_upload.rb', line 65

    def stream_to_file_system(filename=nil)
      if filename.class == String && !block_given?
        @j_del.java_method(:streamToFileSystem, [Java::java.lang.String.java_class]).call(filename)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling stream_to_file_system(filename)"
    end