Class List Method List File List

# Class: VertxWebCommon::MultipartForm

Inherits:
  Object
  - Object
  - VertxWebCommon::MultipartForm
  show all
Defined in:
  /Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-common/multipart_form.rb

## Overview

A multipart form.

## Constant Summary

@@j_api_type =

      Object.new

## Class Method Summary (collapse)

- + (Boolean) accept?(obj)
- + (::VertxWebCommon::MultipartForm) create
  A multipart form instance.
- + (Object) j_api_type
- + (Object) j_class
- + (Object) unwrap(obj)
- + (Object) wrap(obj)

## Instance Method Summary (collapse)

- - (self) attribute(name = nil, value = nil)
  Add an attribute form data part.
- - (self) binary_file_upload(name = nil, filename = nil, pathname = nil, mediaType = nil)
  Add a binary file upload form data part.
- - (self) text_file_upload(name = nil, filename = nil, pathname = nil, mediaType = nil)
  Add a text file upload form data part.

## Class Method Details

### + (`Boolean`) accept?(obj)

Returns:

- (`Boolean`)

    18
    19
    20
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-common/multipart_form.rb', line 18

    def @@j_api_type.accept?(obj)
      obj.class == MultipartForm
    end

### + (`::VertxWebCommon::MultipartForm`) create

Returns a multipart form instance

Returns:

- (`::VertxWebCommon::MultipartForm`) —
  a multipart form instance

Raises:

- (`ArgumentError`)

    34
    35
    36
    37
    38
    39
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-common/multipart_form.rb', line 34

    def self.create
      if !block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebMultipart::MultipartForm.java_method(:create, []).call(),::VertxWebCommon::MultipartForm)
      end
      raise ArgumentError, "Invalid arguments when calling create()"
    end

### + (`Object`) j_api_type

    27
    28
    29
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-common/multipart_form.rb', line 27

    def self.j_api_type
      @@j_api_type
    end

### + (`Object`) j_class

    30
    31
    32
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-common/multipart_form.rb', line 30

    def self.j_class
      Java::IoVertxExtWebMultipart::MultipartForm.java_class
    end

### + (`Object`) unwrap(obj)

    24
    25
    26
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-common/multipart_form.rb', line 24

    def @@j_api_type.unwrap(obj)
      obj.j_del
    end

### + (`Object`) wrap(obj)

    21
    22
    23
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-common/multipart_form.rb', line 21

    def @@j_api_type.wrap(obj)
      MultipartForm.new(obj)
    end

## Instance Method Details

### - (`self`) attribute(name = nil, value = nil)

Add an attribute form data part.

Parameters:

- name (`String`) (defaults to: `nil`) —
  the name of the attribute
- value (`String`) (defaults to: `nil`) —
  the value of the attribute

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    44
    45
    46
    47
    48
    49
    50
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-common/multipart_form.rb', line 44

    def attribute(name=nil,value=nil)
      if name.class == String && value.class == String && !block_given?
        @j_del.java_method(:attribute, [Java::java.lang.String.java_class,Java::java.lang.String.java_class]).call(name,value)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling attribute(#{name},#{value})"
    end

### - (`self`) binary_file_upload(name = nil, filename = nil, pathname = nil, mediaType = nil)

Add a binary file upload form data part.

Parameters:

- name (`String`) (defaults to: `nil`) —
  name of the parameter
- filename (`String`) (defaults to: `nil`) —
  filename of the file
- pathname (`String`) (defaults to: `nil`) —
  the pathname of the file
- mediaType (`String`) (defaults to: `nil`) —
  the MIME type of the file

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    70
    71
    72
    73
    74
    75
    76
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-common/multipart_form.rb', line 70

    def binary_file_upload(name=nil,filename=nil,pathname=nil,mediaType=nil)
      if name.class == String && filename.class == String && pathname.class == String && mediaType.class == String && !block_given?
        @j_del.java_method(:binaryFileUpload, [Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::java.lang.String.java_class]).call(name,filename,pathname,mediaType)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling binary_file_upload(#{name},#{filename},#{pathname},#{mediaType})"
    end

### - (`self`) text_file_upload(name = nil, filename = nil, pathname = nil, mediaType = nil)

Add a text file upload form data part.

Parameters:

- name (`String`) (defaults to: `nil`) —
  name of the parameter
- filename (`String`) (defaults to: `nil`) —
  filename of the file
- pathname (`String`) (defaults to: `nil`) —
  the pathname of the file
- mediaType (`String`) (defaults to: `nil`) —
  the MIME type of the file

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    57
    58
    59
    60
    61
    62
    63
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web-common/multipart_form.rb', line 57

    def text_file_upload(name=nil,filename=nil,pathname=nil,mediaType=nil)
      if name.class == String && filename.class == String && pathname.class == String && mediaType.class == String && !block_given?
        @j_del.java_method(:textFileUpload, [Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::java.lang.String.java_class]).call(name,filename,pathname,mediaType)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling text_file_upload(#{name},#{filename},#{pathname},#{mediaType})"
    end