A handler for serving static resources from the file system or classpath.

no subtypes hierarchy

Initializer
StaticHandler(StaticHandler unknown)
Inherited Attributes
Attributes inherited from: Object
hash, string
Methods
handleshared default void handle(RoutingContext arg0)
setAllowRootFileSystemAccessshared default StaticHandler setAllowRootFileSystemAccess(Boolean allowRootFileSystemAccess)

Enable/Disable access to the root of the filesystem

Parameters:
  • allowRootFileSystemAccess

    whether root access is allowed

setAlwaysAsyncFSshared default StaticHandler setAlwaysAsyncFS(Boolean alwaysAsyncFS)

Set whether async filesystem access should always be used

Parameters:
  • alwaysAsyncFS

    true for always async FS access

setCacheEntryTimeoutshared default StaticHandler setCacheEntryTimeout(Integer timeout)

Set the server cache entry timeout when caching is enabled

Parameters:
  • timeout

    the timeout, in ms

setCachingEnabledshared default StaticHandler setCachingEnabled(Boolean enabled)

Set whether cache header handling is enabled

Parameters:
  • enabled

    true if enabled

setDefaultContentEncodingshared default StaticHandler setDefaultContentEncoding(String contentEncoding)

Set the default content encoding for text related files. This allows overriding the system settings default value.

Parameters:
  • contentEncoding

    the desired content encoding e.g.: “UTF-8”

setDirectoryListingshared default StaticHandler setDirectoryListing(Boolean directoryListing)

Set whether directory listing is enabled

Parameters:
  • directoryListing

    true if enabled

setDirectoryTemplateshared default StaticHandler setDirectoryTemplate(String directoryTemplate)

Set the directory template to be used when directory listing

Parameters:
  • directoryTemplate

    the directory template

setEnableFSTuningshared default StaticHandler setEnableFSTuning(Boolean enableFSTuning)

Set whether async/sync filesystem tuning should enabled

Parameters:
  • enableFSTuning

    true to enabled FS tuning

setEnableRangeSupportshared default StaticHandler setEnableRangeSupport(Boolean enableRangeSupport)

Set whether range requests (resumable downloads; media streaming) should be enabled.

Parameters:
  • enableRangeSupport

    true to enable range support

setFilesReadOnlyshared default StaticHandler setFilesReadOnly(Boolean readOnly)

Set whether files are read-only and will never change

Parameters:
  • readOnly

    whether files are read-only

setIncludeHiddenshared default StaticHandler setIncludeHidden(Boolean includeHidden)

Set whether hidden files should be served

Parameters:
  • includeHidden

    true if hidden files should be served

setIndexPageshared default StaticHandler setIndexPage(String indexPage)

Set the index page

Parameters:
  • indexPage

    the index page

setMaxAgeSecondsshared default StaticHandler setMaxAgeSeconds(Integer maxAgeSeconds)

Set value for max age in caching headers

Parameters:
  • maxAgeSeconds

    maximum time for browser to cache, in seconds

setMaxAvgServeTimeNsshared default StaticHandler setMaxAvgServeTimeNs(Integer maxAvgServeTimeNanoSeconds)

Set the max serve time in ns, above which serves are considered slow

Parameters:
  • maxAvgServeTimeNanoSeconds

    max serve time, in ns

setMaxCacheSizeshared default StaticHandler setMaxCacheSize(Integer maxCacheSize)

Set the max cache size, when caching is enabled

Parameters:
  • maxCacheSize

    the max cache size

setSendVaryHeadershared default StaticHandler setSendVaryHeader(Boolean varyHeader)

Set whether vary header should be sent with response.

Parameters:
  • varyHeader

    true to sent vary header

setWebRootshared default StaticHandler setWebRoot(String webRoot)

Set the web root

Parameters:
  • webRoot

    the web root

Inherited Methods
Methods inherited from: Object
equals