public class StaticHandler extends Object implements Handler<RoutingContext>
original non RX-ified interface using Vert.x codegen.| Constructor and Description |
|---|
StaticHandler(StaticHandler delegate) |
| Modifier and Type | Method and Description |
|---|---|
static StaticHandler |
create()
Create a handler using defaults
|
static StaticHandler |
create(String root)
Create a handler, specifying web-root
|
Object |
getDelegate() |
void |
handle(RoutingContext arg0)
Something has happened, so handle it.
|
static StaticHandler |
newInstance(StaticHandler arg) |
StaticHandler |
setAlwaysAsyncFS(boolean alwaysAsyncFS)
Set whether async filesystem access should always be used
|
StaticHandler |
setCacheEntryTimeout(long timeout)
Set the server cache entry timeout when caching is enabled
|
StaticHandler |
setCachingEnabled(boolean enabled)
Set whether cache header handling is enabled
|
StaticHandler |
setDirectoryListing(boolean directoryListing)
Set whether directory listing is enabled
|
StaticHandler |
setDirectoryTemplate(String directoryTemplate)
Set the directory template to be used when directory listing
|
StaticHandler |
setEnableFSTuning(boolean enableFSTuning)
Set whether async/sync filesystem tuning should enabled
|
StaticHandler |
setEnableRangeSupport(boolean enableRangeSupport)
Set whether range requests (resumable downloads; media streaming) should be enabled.
|
StaticHandler |
setFilesReadOnly(boolean readOnly)
Set whether files are read-only and will never change
|
StaticHandler |
setIncludeHidden(boolean includeHidden)
Set whether hidden files should be served
|
StaticHandler |
setIndexPage(String indexPage)
Set the index page
|
StaticHandler |
setMaxAgeSeconds(long maxAgeSeconds)
Set value for max age in caching headers
|
StaticHandler |
setMaxAvgServeTimeNs(long maxAvgServeTimeNanoSeconds)
Set the max serve time in ns, above which serves are considered slow
|
StaticHandler |
setMaxCacheSize(int maxCacheSize)
Set the max cache size, when caching is enabled
|
StaticHandler |
setWebRoot(String webRoot)
Set the web root
|
public StaticHandler(StaticHandler delegate)
public Object getDelegate()
public void handle(RoutingContext arg0)
Handlerhandle in interface Handler<RoutingContext>arg0 - the event to handlepublic static StaticHandler create()
public static StaticHandler create(String root)
root - the web-rootpublic StaticHandler setWebRoot(String webRoot)
webRoot - the web rootpublic StaticHandler setFilesReadOnly(boolean readOnly)
readOnly - whether files are read-onlypublic StaticHandler setMaxAgeSeconds(long maxAgeSeconds)
maxAgeSeconds - maximum time for browser to cache, in secondspublic StaticHandler setCachingEnabled(boolean enabled)
enabled - true if enabledpublic StaticHandler setDirectoryListing(boolean directoryListing)
directoryListing - true if enabledpublic StaticHandler setIncludeHidden(boolean includeHidden)
includeHidden - true if hidden files should be servedpublic StaticHandler setCacheEntryTimeout(long timeout)
timeout - the timeout, in mspublic StaticHandler setIndexPage(String indexPage)
indexPage - the index pagepublic StaticHandler setMaxCacheSize(int maxCacheSize)
maxCacheSize - the max cache sizepublic StaticHandler setAlwaysAsyncFS(boolean alwaysAsyncFS)
alwaysAsyncFS - true for always async FS accesspublic StaticHandler setEnableFSTuning(boolean enableFSTuning)
enableFSTuning - true to enabled FS tuningpublic StaticHandler setMaxAvgServeTimeNs(long maxAvgServeTimeNanoSeconds)
maxAvgServeTimeNanoSeconds - max serve time, in nspublic StaticHandler setDirectoryTemplate(String directoryTemplate)
directoryTemplate - the directory templatepublic StaticHandler setEnableRangeSupport(boolean enableRangeSupport)
enableRangeSupport - true to enable range supportpublic static StaticHandler newInstance(StaticHandler arg)
Copyright © 2015. All rights reserved.