interface StaticHandler : Handler<RoutingContext>
A handler for serving static resources from the file system or classpath.
Author
Tim Fox
static val DEFAULT_ALWAYS_ASYNC_FS: Boolean
Default of whether async filesystem access should always be used |
|
static val DEFAULT_CACHE_ENTRY_TIMEOUT: Long
Default cache entry timeout, when caching |
|
static val DEFAULT_CACHING_ENABLED: Boolean
Default of whether cache header handling is enabled |
|
static val DEFAULT_DIRECTORY_LISTING: Boolean
Default of whether directory listing is enabled |
|
static val DEFAULT_DIRECTORY_TEMPLATE: String
Default template file to use for directory listing |
|
static val DEFAULT_ENABLE_FS_TUNING: Boolean
Default of whether fs async/sync tuning should be used |
|
static val DEFAULT_FILES_READ_ONLY: Boolean
Default value of whether files are read -only and never will be updated |
|
static val DEFAULT_INCLUDE_HIDDEN: Boolean
Default of whether hidden files can be served |
|
static val DEFAULT_INDEX_PAGE: String
The default index page |
|
static val DEFAULT_MAX_AGE_SECONDS: Long
Default max age for cache headers |
|
static val DEFAULT_MAX_AVG_SERVE_TIME_NS: Long
Default max avg serve time, in ns, over which serving will be considered slow |
|
static val DEFAULT_MAX_CACHE_SIZE: Int
The default max cache size |
|
static val DEFAULT_RANGE_SUPPORT: Boolean
Default of whether Range request handling support should be used |
|
static val DEFAULT_ROOT_FILESYSTEM_ACCESS: Boolean
Default of whether access to the root of the file system should be allowed or just allow from the current working directory. |
|
static val DEFAULT_SEND_VARY_HEADER: Boolean
Default of whether vary header should be sent. |
|
static val DEFAULT_WEB_ROOT: String
Default value of the web-root, where files are served from |
open static fun create(): StaticHandler
Create a handler using defaults open static fun create(root: String): StaticHandler
Create a handler, specifying web-root open static fun create(root: String, classLoader: ClassLoader): StaticHandler
Create a handler, specifying web-root and a classloader used to load the resources. |
|
abstract fun setAllowRootFileSystemAccess(allowRootFileSystemAccess: Boolean): StaticHandler
Enable/Disable access to the root of the filesystem |
|
abstract fun setAlwaysAsyncFS(alwaysAsyncFS: Boolean): StaticHandler
Set whether async filesystem access should always be used |
|
abstract fun setCacheEntryTimeout(timeout: Long): StaticHandler
Set the server cache entry timeout when caching is enabled |
|
abstract fun setCachingEnabled(enabled: Boolean): StaticHandler
Set whether cache header handling is enabled |
|
abstract fun setDefaultContentEncoding(contentEncoding: String): StaticHandler
Set the default content encoding for text related files. This allows overriding the system settings default value. |
|
abstract fun setDirectoryListing(directoryListing: Boolean): StaticHandler
Set whether directory listing is enabled |
|
abstract fun setDirectoryTemplate(directoryTemplate: String): StaticHandler
Set the directory template to be used when directory listing |
|
abstract fun setEnableFSTuning(enableFSTuning: Boolean): StaticHandler
Set whether async/sync filesystem tuning should enabled |
|
abstract fun setEnableRangeSupport(enableRangeSupport: Boolean): StaticHandler
Set whether range requests (resumable downloads; media streaming) should be enabled. |
|
abstract fun setFilesReadOnly(readOnly: Boolean): StaticHandler
Set whether files are read-only and will never change |
|
abstract fun setHttp2PushMapping(http2PushMappings: MutableList<Http2PushMapping>): StaticHandler
Set the file mapping for http2push and link preload |
|
abstract fun setIncludeHidden(includeHidden: Boolean): StaticHandler
Set whether hidden files should be served |
|
abstract fun setIndexPage(indexPage: String): StaticHandler
Set the index page |
|
abstract fun setMaxAgeSeconds(maxAgeSeconds: Long): StaticHandler
Set value for max age in caching headers |
|
abstract fun setMaxAvgServeTimeNs(maxAvgServeTimeNanoSeconds: Long): StaticHandler
Set the max serve time in ns, above which serves are considered slow |
|
abstract fun setMaxCacheSize(maxCacheSize: Int): StaticHandler
Set the max cache size, when caching is enabled |
|
abstract fun setSendVaryHeader(varyHeader: Boolean): StaticHandler
Set whether vary header should be sent with response. |
|
abstract fun setWebRoot(webRoot: String): StaticHandler
Set the web root |