Class: VertxWeb::StaticHandler
- Inherits:
-
Object
- Object
- VertxWeb::StaticHandler
- Defined in:
- /Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/static_handler.rb
Overview
A handler for serving static resources from the file system or classpath.
Class Method Summary (collapse)
-
+ (::VertxWeb::StaticHandler) create(root = nil)
Create a handler, specifying web-root.
Instance Method Summary (collapse)
- - (void) handle(arg0 = nil)
-
- (self) set_allow_root_file_system_access(allowRootFileSystemAccess = nil)
Enable/Disable access to the root of the filesystem.
-
- (self) set_always_async_fs(alwaysAsyncFS = nil)
Set whether async filesystem access should always be used.
-
- (self) set_cache_entry_timeout(timeout = nil)
Set the server cache entry timeout when caching is enabled.
-
- (self) set_caching_enabled(enabled = nil)
Set whether cache header handling is enabled.
-
- (self) set_directory_listing(directoryListing = nil)
Set whether directory listing is enabled.
-
- (self) set_directory_template(directoryTemplate = nil)
Set the directory template to be used when directory listing.
-
- (self) set_enable_fs_tuning(enableFSTuning = nil)
Set whether async/sync filesystem tuning should enabled.
-
- (self) set_enable_range_support(enableRangeSupport = nil)
Set whether range requests (resumable downloads; media streaming) should be enabled.
-
- (self) set_files_read_only(readOnly = nil)
Set whether files are read-only and will never change.
-
- (self) set_include_hidden(includeHidden = nil)
Set whether hidden files should be served.
-
- (self) set_index_page(indexPage = nil)
Set the index page.
-
- (self) set_max_age_seconds(maxAgeSeconds = nil)
Set value for max age in caching headers.
-
- (self) set_max_avg_serve_time_ns(maxAvgServeTimeNanoSeconds = nil)
Set the max serve time in ns, above which serves are considered slow.
-
- (self) set_max_cache_size(maxCacheSize = nil)
Set the max cache size, when caching is enabled.
-
- (self) set_web_root(webRoot = nil)
Set the web root.
Class Method Details
+ (::VertxWeb::StaticHandler) create(root = nil)
Create a handler, specifying web-root
28 29 30 31 32 33 34 35 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/static_handler.rb', line 28 def self.create(root=nil) if !block_given? && root == nil return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebHandler::StaticHandler.java_method(:create, []).call(),::VertxWeb::StaticHandler) elsif root.class == String && !block_given? return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebHandler::StaticHandler.java_method(:create, [Java::java.lang.String.java_class]).call(root),::VertxWeb::StaticHandler) end raise ArgumentError, "Invalid arguments when calling create(root)" end |
Instance Method Details
- (void) handle(arg0 = nil)
This method returns an undefined value.
19 20 21 22 23 24 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/static_handler.rb', line 19 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 |
- (self) set_allow_root_file_system_access(allowRootFileSystemAccess = nil)
Enable/Disable access to the root of the filesystem
39 40 41 42 43 44 45 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/static_handler.rb', line 39 def set_allow_root_file_system_access(allowRootFileSystemAccess=nil) if (allowRootFileSystemAccess.class == TrueClass || allowRootFileSystemAccess.class == FalseClass) && !block_given? @j_del.java_method(:setAllowRootFileSystemAccess, [Java::boolean.java_class]).call(allowRootFileSystemAccess) return self end raise ArgumentError, "Invalid arguments when calling set_allow_root_file_system_access(allowRootFileSystemAccess)" end |
- (self) set_always_async_fs(alwaysAsyncFS = nil)
Set whether async filesystem access should always be used
139 140 141 142 143 144 145 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/static_handler.rb', line 139 def set_always_async_fs(alwaysAsyncFS=nil) if (alwaysAsyncFS.class == TrueClass || alwaysAsyncFS.class == FalseClass) && !block_given? @j_del.java_method(:setAlwaysAsyncFS, [Java::boolean.java_class]).call(alwaysAsyncFS) return self end raise ArgumentError, "Invalid arguments when calling set_always_async_fs(alwaysAsyncFS)" end |
- (self) set_cache_entry_timeout(timeout = nil)
Set the server cache entry timeout when caching is enabled
109 110 111 112 113 114 115 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/static_handler.rb', line 109 def set_cache_entry_timeout(timeout=nil) if timeout.class == Fixnum && !block_given? @j_del.java_method(:setCacheEntryTimeout, [Java::long.java_class]).call(timeout) return self end raise ArgumentError, "Invalid arguments when calling set_cache_entry_timeout(timeout)" end |
- (self) set_caching_enabled(enabled = nil)
Set whether cache header handling is enabled
79 80 81 82 83 84 85 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/static_handler.rb', line 79 def set_caching_enabled(enabled=nil) if (enabled.class == TrueClass || enabled.class == FalseClass) && !block_given? @j_del.java_method(:setCachingEnabled, [Java::boolean.java_class]).call(enabled) return self end raise ArgumentError, "Invalid arguments when calling set_caching_enabled(enabled)" end |
- (self) set_directory_listing(directoryListing = nil)
Set whether directory listing is enabled
89 90 91 92 93 94 95 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/static_handler.rb', line 89 def set_directory_listing(directoryListing=nil) if (directoryListing.class == TrueClass || directoryListing.class == FalseClass) && !block_given? @j_del.java_method(:setDirectoryListing, [Java::boolean.java_class]).call(directoryListing) return self end raise ArgumentError, "Invalid arguments when calling set_directory_listing(directoryListing)" end |
- (self) set_directory_template(directoryTemplate = nil)
Set the directory template to be used when directory listing
169 170 171 172 173 174 175 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/static_handler.rb', line 169 def set_directory_template(directoryTemplate=nil) if directoryTemplate.class == String && !block_given? @j_del.java_method(:setDirectoryTemplate, [Java::java.lang.String.java_class]).call(directoryTemplate) return self end raise ArgumentError, "Invalid arguments when calling set_directory_template(directoryTemplate)" end |
- (self) set_enable_fs_tuning(enableFSTuning = nil)
Set whether async/sync filesystem tuning should enabled
149 150 151 152 153 154 155 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/static_handler.rb', line 149 def set_enable_fs_tuning(enableFSTuning=nil) if (enableFSTuning.class == TrueClass || enableFSTuning.class == FalseClass) && !block_given? @j_del.java_method(:setEnableFSTuning, [Java::boolean.java_class]).call(enableFSTuning) return self end raise ArgumentError, "Invalid arguments when calling set_enable_fs_tuning(enableFSTuning)" end |
- (self) set_enable_range_support(enableRangeSupport = nil)
Set whether range requests (resumable downloads; media streaming) should be enabled.
179 180 181 182 183 184 185 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/static_handler.rb', line 179 def set_enable_range_support(enableRangeSupport=nil) if (enableRangeSupport.class == TrueClass || enableRangeSupport.class == FalseClass) && !block_given? @j_del.java_method(:setEnableRangeSupport, [Java::boolean.java_class]).call(enableRangeSupport) return self end raise ArgumentError, "Invalid arguments when calling set_enable_range_support(enableRangeSupport)" end |
- (self) set_files_read_only(readOnly = nil)
Set whether files are read-only and will never change
59 60 61 62 63 64 65 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/static_handler.rb', line 59 def set_files_read_only(readOnly=nil) if (readOnly.class == TrueClass || readOnly.class == FalseClass) && !block_given? @j_del.java_method(:setFilesReadOnly, [Java::boolean.java_class]).call(readOnly) return self end raise ArgumentError, "Invalid arguments when calling set_files_read_only(readOnly)" end |
- (self) set_include_hidden(includeHidden = nil)
Set whether hidden files should be served
99 100 101 102 103 104 105 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/static_handler.rb', line 99 def set_include_hidden(includeHidden=nil) if (includeHidden.class == TrueClass || includeHidden.class == FalseClass) && !block_given? @j_del.java_method(:setIncludeHidden, [Java::boolean.java_class]).call(includeHidden) return self end raise ArgumentError, "Invalid arguments when calling set_include_hidden(includeHidden)" end |
- (self) set_index_page(indexPage = nil)
Set the index page
119 120 121 122 123 124 125 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/static_handler.rb', line 119 def set_index_page(indexPage=nil) if indexPage.class == String && !block_given? @j_del.java_method(:setIndexPage, [Java::java.lang.String.java_class]).call(indexPage) return self end raise ArgumentError, "Invalid arguments when calling set_index_page(indexPage)" end |
- (self) set_max_age_seconds(maxAgeSeconds = nil)
Set value for max age in caching headers
69 70 71 72 73 74 75 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/static_handler.rb', line 69 def set_max_age_seconds(maxAgeSeconds=nil) if maxAgeSeconds.class == Fixnum && !block_given? @j_del.java_method(:setMaxAgeSeconds, [Java::long.java_class]).call(maxAgeSeconds) return self end raise ArgumentError, "Invalid arguments when calling set_max_age_seconds(maxAgeSeconds)" end |
- (self) set_max_avg_serve_time_ns(maxAvgServeTimeNanoSeconds = nil)
Set the max serve time in ns, above which serves are considered slow
159 160 161 162 163 164 165 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/static_handler.rb', line 159 def set_max_avg_serve_time_ns(maxAvgServeTimeNanoSeconds=nil) if maxAvgServeTimeNanoSeconds.class == Fixnum && !block_given? @j_del.java_method(:setMaxAvgServeTimeNs, [Java::long.java_class]).call(maxAvgServeTimeNanoSeconds) return self end raise ArgumentError, "Invalid arguments when calling set_max_avg_serve_time_ns(maxAvgServeTimeNanoSeconds)" end |
- (self) set_max_cache_size(maxCacheSize = nil)
Set the max cache size, when caching is enabled
129 130 131 132 133 134 135 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/static_handler.rb', line 129 def set_max_cache_size(maxCacheSize=nil) if maxCacheSize.class == Fixnum && !block_given? @j_del.java_method(:setMaxCacheSize, [Java::int.java_class]).call(maxCacheSize) return self end raise ArgumentError, "Invalid arguments when calling set_max_cache_size(maxCacheSize)" end |
- (self) set_web_root(webRoot = nil)
Set the web root
49 50 51 52 53 54 55 |
# File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/static_handler.rb', line 49 def set_web_root(webRoot=nil) if webRoot.class == String && !block_given? @j_del.java_method(:setWebRoot, [Java::java.lang.String.java_class]).call(webRoot) return self end raise ArgumentError, "Invalid arguments when calling set_web_root(webRoot)" end |