Class List Method List File List

# Class: VertxWeb::FaviconHandler

Inherits:
  Object
  - Object
  - VertxWeb::FaviconHandler
  show all
Defined in:
  /Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/favicon_handler.rb

## Overview

A handler that serves favicons.

If no file system path is specified it will attempt to serve a resource called `favicon.ico` from the classpath.

## Constant Summary

@@j_api_type =

      Object.new

## Class Method Summary (collapse)

- + (Boolean) accept?(obj)
- + (::VertxWeb::FaviconHandler) create(param_1 = nil, param_2 = nil)
  Create a handler attempting to load favicon file from the specified path, and with the specified max cache time.
- + (Object) j_api_type
- + (Object) j_class
- + (Object) unwrap(obj)
- + (Object) wrap(obj)

## Instance Method Summary (collapse)

- - (void) handle(arg0 = nil)

## Class Method Details

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

Returns:

- (`Boolean`)

    20
    21
    22
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/favicon_handler.rb', line 20

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

### + (`::VertxWeb::FaviconHandler`) create + (`::VertxWeb::FaviconHandler`) create(path) + (`::VertxWeb::FaviconHandler`) create(maxAgeSeconds) + (`::VertxWeb::FaviconHandler`) create(path, maxAgeSeconds)

Create a handler attempting to load favicon file from the specified path, and with the specified max cache time

Overloads:

- + (`::VertxWeb::FaviconHandler`) create(path)

  Parameters:

  - path (`String`) —
    the path
- + (`::VertxWeb::FaviconHandler`) create(maxAgeSeconds)

  Parameters:

  - maxAgeSeconds (`Fixnum`) —
    max how long the file will be cached by browser, in seconds
- + (`::VertxWeb::FaviconHandler`) create(path, maxAgeSeconds)

  Parameters:

  - path (`String`) —
    the path
  - maxAgeSeconds (`Fixnum`) —
    max how long the file will be cached by browser, in seconds

Returns:

- (`::VertxWeb::FaviconHandler`) —
  the handler

Raises:

- (`ArgumentError`)

    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/favicon_handler.rb', line 53

    def self.create(param_1=nil,param_2=nil)
      if !block_given? && param_1 == nil && param_2 == nil
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebHandler::FaviconHandler.java_method(:create, []).call(),::VertxWeb::FaviconHandler)
      elsif param_1.class == String && !block_given? && param_2 == nil
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebHandler::FaviconHandler.java_method(:create, [Java::java.lang.String.java_class]).call(param_1),::VertxWeb::FaviconHandler)
      elsif param_1.class == Fixnum && !block_given? && param_2 == nil
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebHandler::FaviconHandler.java_method(:create, [Java::long.java_class]).call(param_1),::VertxWeb::FaviconHandler)
      elsif param_1.class == String && param_2.class == Fixnum && !block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebHandler::FaviconHandler.java_method(:create, [Java::java.lang.String.java_class,Java::long.java_class]).call(param_1,param_2),::VertxWeb::FaviconHandler)
      end
      raise ArgumentError, "Invalid arguments when calling create(#{param_1},#{param_2})"
    end

### + (`Object`) j_api_type

    29
    30
    31
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/favicon_handler.rb', line 29

    def self.j_api_type
      @@j_api_type
    end

### + (`Object`) j_class

    32
    33
    34
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/favicon_handler.rb', line 32

    def self.j_class
      Java::IoVertxExtWebHandler::FaviconHandler.java_class
    end

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

    26
    27
    28
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/favicon_handler.rb', line 26

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

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

    23
    24
    25
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/favicon_handler.rb', line 23

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

## Instance Method Details

### - (`void`) handle(arg0 = nil)

This method returns an undefined value.

Parameters:

- arg0 (`::VertxWeb::RoutingContext`) (defaults to: `nil`)

Raises:

- (`ArgumentError`)

    37
    38
    39
    40
    41
    42
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/favicon_handler.rb', line 37

    def handle(arg0=nil)
      if arg0.class.method_defined?(:j_del) && !block_given?
        return @j_del.java_method(:handle, [Java::IoVertxExtWeb::RoutingContext.java_class]).call(arg0.j_del)
      end
      raise ArgumentError, "Invalid arguments when calling handle(#{arg0})"
    end