@CompileStatic class StaticHandler
A handler for serving static resources from the file system or classpath.
| Constructor and description |
|---|
StaticHandler
(Object delegate) |
| Type | Name 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) |
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 |
Create a handler using defaults
Create a handler, specifying web-root
root - the web-rootSet 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 rootio.vertx:vertx-web:3.1.0