Class: VertxWeb::FaviconHandler

Inherits:
Object
  • Object
show all
Defined in:
/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/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)

Instance Method Summary (collapse)

Class Method Details

+ (Boolean) accept?(obj)

Returns:

  • (Boolean)


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

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:



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/favicon_handler.rb', line 46

def self.create(*args)
  if !block_given? && args[0] == nil && args[1] == nil
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebHandler::FaviconHandler.java_method(:create, []).call(),::VertxWeb::FaviconHandler)
  elsif args[0].class == String && !block_given? && args[1] == nil
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebHandler::FaviconHandler.java_method(:create, [Java::java.lang.String.java_class]).call(args[0]),::VertxWeb::FaviconHandler)
  elsif args[0].class == Fixnum && !block_given? && args[1] == nil
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebHandler::FaviconHandler.java_method(:create, [Java::long.java_class]).call(args[0]),::VertxWeb::FaviconHandler)
  elsif args[0].class == String && args[1].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(args[0],args[1]),::VertxWeb::FaviconHandler)
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling create(#{args[0]},#{args[1]})"
  end
end

+ (Object) DEFAULT_MAX_AGE_SECONDS

The default max age in seconds as set in the cache-control header


77
78
79
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/favicon_handler.rb', line 77

def self.DEFAULT_MAX_AGE_SECONDS
  Java::IoVertxExtWebHandler::FaviconHandler.DEFAULT_MAX_AGE_SECONDS
end

+ (Object) j_api_type



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

def self.j_api_type
  @@j_api_type
end

+ (Object) j_class



33
34
35
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/favicon_handler.rb', line 33

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

+ (Object) unwrap(obj)



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

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

+ (Object) wrap(obj)



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

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

Instance Method Details

- (void) handle(event)

This method returns an undefined value.

Something has happened, so handle it.

Parameters:



66
67
68
69
70
71
72
73
74
75
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-web/favicon_handler.rb', line 66

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