@groovy.transform.CompileStatic class StaticHandler extends java.lang.Object
A handler for serving static resources from the file system or classpath.
Constructor and description |
---|
StaticHandler
(java.lang.Object delegate) |
Type | Name and description |
---|---|
static StaticHandler |
create() Create a handler using defaults |
static StaticHandler |
create(java.lang.String root) Create a handler, specifying web-root |
java.lang.Object |
getDelegate() |
void |
handle(RoutingContext arg0) |
StaticHandler |
setAllowRootFileSystemAccess(boolean allowRootFileSystemAccess) Enable/Disable access to the root of the filesystem |
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(java.lang.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(java.lang.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(java.lang.String webRoot) Set the web root |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Create a handler using defaults
Create a handler, specifying web-root
root
- the web-rootEnable/Disable access to the root of the filesystem
allowRootFileSystemAccess
- whether root access is allowedSet whether async filesystem access should always be used
alwaysAsyncFS
- true for always async FS accessSet the server cache entry timeout when caching is enabled
timeout
- the timeout, in msSet whether cache header handling is enabled
enabled
- true if enabledSet whether directory listing is enabled
directoryListing
- true if enabledSet the directory template to be used when directory listing
directoryTemplate
- the directory templateSet whether async/sync filesystem tuning should enabled
enableFSTuning
- true to enabled FS tuningSet whether range requests (resumable downloads; media streaming) should be enabled.
enableRangeSupport
- true to enable range supportSet whether files are read-only and will never change
readOnly
- whether files are read-onlySet whether hidden files should be served
includeHidden
- true if hidden files should be servedSet the index page
indexPage
- the index pageSet value for max age in caching headers
maxAgeSeconds
- maximum time for browser to cache, in secondsSet the max serve time in ns, above which serves are considered slow
maxAvgServeTimeNanoSeconds
- max serve time, in nsSet the max cache size, when caching is enabled
maxCacheSize
- the max cache sizeSet the web root
webRoot
- the web root