Package io.vertx.mutiny.ext.web.handler
Class StaticHandler
java.lang.Object
io.vertx.mutiny.ext.web.handler.StaticHandler
- All Implemented Interfaces:
MutinyDelegate
,io.vertx.core.Handler<RoutingContext>
,Consumer<RoutingContext>
public class StaticHandler
extends Object
implements MutinyDelegate, io.vertx.core.Handler<RoutingContext>, Consumer<RoutingContext>
A handler for serving static resources from the file system or classpath.
NOTE: This class has been automatically generated from the
original
non Mutiny-ified interface using Vert.x codegen.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TypeArg<StaticHandler>
static final boolean
Default of whether async filesystem access should always be usedstatic final long
Default cache entry timeout, when cachingstatic final boolean
Default of whether cache header handling is enabledstatic final boolean
Default of whether directory listing is enabledstatic final String
Default template file to use for directory listingstatic final boolean
Default of whether fs async/sync tuning should be usedstatic final boolean
Default value of whether files are read -only and never will be updatedstatic final boolean
Default of whether hidden files can be servedstatic final String
The default index pagestatic final long
Default max age for cache headersstatic final long
Default max avg serve time, in ns, over which serving will be considered slowstatic final int
The default max cache sizestatic final boolean
Default of whether Range request handling support should be usedstatic final boolean
Default of whether access to the root of the file system should be allowed or just allow from the current working directory.static final boolean
Default of whether vary header should be sent.static final String
Default value of the web-root, where files are served from -
Constructor Summary
ConstructorsConstructorDescriptionStaticHandler
(io.vertx.ext.web.handler.StaticHandler delegate) StaticHandler
(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(RoutingContext item) static StaticHandler
create()
static StaticHandler
static StaticHandler
boolean
io.vertx.ext.web.handler.StaticHandler
void
handle
(RoutingContext arg0) int
hashCode()
static StaticHandler
newInstance
(io.vertx.ext.web.handler.StaticHandler arg) setAllowRootFileSystemAccess
(boolean allowRootFileSystemAccess) Deprecated.setAlwaysAsyncFS
(boolean alwaysAsyncFS) setCacheEntryTimeout
(long timeout) setCachingEnabled
(boolean enabled) setDefaultContentEncoding
(String contentEncoding) setDirectoryListing
(boolean directoryListing) setDirectoryTemplate
(String directoryTemplate) setEnableFSTuning
(boolean enableFSTuning) setEnableRangeSupport
(boolean enableRangeSupport) setFilesReadOnly
(boolean readOnly) setHttp2PushMapping
(List<io.vertx.ext.web.Http2PushMapping> http2PushMappings) setIncludeHidden
(boolean includeHidden) setIndexPage
(String indexPage) setMaxAgeSeconds
(long maxAgeSeconds) setMaxAvgServeTimeNs
(long maxAvgServeTimeNanoSeconds) setMaxCacheSize
(int maxCacheSize) setSendVaryHeader
(boolean varyHeader) setWebRoot
(String webRoot) Deprecated.skipCompressionForMediaTypes
(Set<String> mediaTypes) skipCompressionForSuffixes
(Set<String> fileSuffixes) toString()
-
Field Details
-
__TYPE_ARG
-
DEFAULT_WEB_ROOT
Default value of the web-root, where files are served from- See Also:
-
DEFAULT_FILES_READ_ONLY
public static final boolean DEFAULT_FILES_READ_ONLYDefault value of whether files are read -only and never will be updated- See Also:
-
DEFAULT_MAX_AGE_SECONDS
public static final long DEFAULT_MAX_AGE_SECONDSDefault max age for cache headers- See Also:
-
DEFAULT_CACHING_ENABLED
public static final boolean DEFAULT_CACHING_ENABLEDDefault of whether cache header handling is enabled -
DEFAULT_DIRECTORY_LISTING
public static final boolean DEFAULT_DIRECTORY_LISTINGDefault of whether directory listing is enabled- See Also:
-
DEFAULT_DIRECTORY_TEMPLATE
Default template file to use for directory listing- See Also:
-
DEFAULT_INCLUDE_HIDDEN
public static final boolean DEFAULT_INCLUDE_HIDDENDefault of whether hidden files can be served- See Also:
-
DEFAULT_CACHE_ENTRY_TIMEOUT
public static final long DEFAULT_CACHE_ENTRY_TIMEOUTDefault cache entry timeout, when caching- See Also:
-
DEFAULT_INDEX_PAGE
The default index page- See Also:
-
DEFAULT_MAX_CACHE_SIZE
public static final int DEFAULT_MAX_CACHE_SIZEThe default max cache size- See Also:
-
DEFAULT_ALWAYS_ASYNC_FS
public static final boolean DEFAULT_ALWAYS_ASYNC_FSDefault of whether async filesystem access should always be used- See Also:
-
DEFAULT_ENABLE_FS_TUNING
public static final boolean DEFAULT_ENABLE_FS_TUNINGDefault of whether fs async/sync tuning should be used- See Also:
-
DEFAULT_MAX_AVG_SERVE_TIME_NS
public static final long DEFAULT_MAX_AVG_SERVE_TIME_NSDefault max avg serve time, in ns, over which serving will be considered slow- See Also:
-
DEFAULT_RANGE_SUPPORT
public static final boolean DEFAULT_RANGE_SUPPORTDefault of whether Range request handling support should be used- See Also:
-
DEFAULT_ROOT_FILESYSTEM_ACCESS
public static final boolean DEFAULT_ROOT_FILESYSTEM_ACCESSDefault of whether access to the root of the file system should be allowed or just allow from the current working directory.- See Also:
-
DEFAULT_SEND_VARY_HEADER
public static final boolean DEFAULT_SEND_VARY_HEADERDefault of whether vary header should be sent.- See Also:
-
-
Constructor Details
-
StaticHandler
public StaticHandler(io.vertx.ext.web.handler.StaticHandler delegate) -
StaticHandler
-
-
Method Details
-
getDelegate
public io.vertx.ext.web.handler.StaticHandler getDelegate()- Specified by:
getDelegate
in interfaceMutinyDelegate
- Returns:
- the delegate used by this Mutiny object of generated type
-
toString
-
equals
-
hashCode
public int hashCode() -
handle
- Specified by:
handle
in interfaceio.vertx.core.Handler<RoutingContext>
-
create
- Returns:
- the handler
-
create
- Parameters:
root
- the web-root- Returns:
- the handler
-
create
public static StaticHandler create(io.vertx.ext.web.handler.FileSystemAccess handlerVisibility, String root) - Parameters:
handlerVisibility
- CWD or file system rootroot
- the web-root- Returns:
- the handler
-
setAllowRootFileSystemAccess
Deprecated.- Parameters:
allowRootFileSystemAccess
- whether root access is allowed- Returns:
- a reference to this, so the API can be used fluently
-
setWebRoot
Deprecated.- Parameters:
webRoot
- the web root- Returns:
- a reference to this, so the API can be used fluently
-
setFilesReadOnly
- Parameters:
readOnly
- whether files are read-only- Returns:
- a reference to this, so the API can be used fluently
-
setMaxAgeSeconds
- Parameters:
maxAgeSeconds
- maximum time for browser to cache, in seconds- Returns:
- a reference to this, so the API can be used fluently
-
setCachingEnabled
- Parameters:
enabled
- true if enabled- Returns:
- a reference to this, so the API can be used fluently
-
setDirectoryListing
- Parameters:
directoryListing
- true if enabled- Returns:
- a reference to this, so the API can be used fluently
-
setIncludeHidden
- Parameters:
includeHidden
- true if hidden files should be served- Returns:
- a reference to this, so the API can be used fluently
-
setCacheEntryTimeout
- Parameters:
timeout
- the timeout, in ms- Returns:
- a reference to this, so the API can be used fluently
-
setIndexPage
- Parameters:
indexPage
- the index page- Returns:
- a reference to this, so the API can be used fluently
-
setMaxCacheSize
- Parameters:
maxCacheSize
- the max cache size- Returns:
- a reference to this, so the API can be used fluently
-
setHttp2PushMapping
- Parameters:
http2PushMappings
- the mapping for http2 push- Returns:
- a reference to this, so the API can be used fluently
-
skipCompressionForMediaTypes
- Parameters:
mediaTypes
- the set of mime types that are already compressed- Returns:
- a reference to this, so the API can be used fluently
-
skipCompressionForSuffixes
- Parameters:
fileSuffixes
- the set of file suffixes that are already compressed- Returns:
- a reference to this, so the API can be used fluently
-
setAlwaysAsyncFS
- Parameters:
alwaysAsyncFS
- true for always async FS access- Returns:
- a reference to this, so the API can be used fluently
-
setEnableFSTuning
- Parameters:
enableFSTuning
- true to enabled FS tuning- Returns:
- a reference to this, so the API can be used fluently
-
setMaxAvgServeTimeNs
- Parameters:
maxAvgServeTimeNanoSeconds
- max serve time, in ns- Returns:
- a reference to this, so the API can be used fluently
-
setDirectoryTemplate
- Parameters:
directoryTemplate
- the directory template- Returns:
- a reference to this, so the API can be used fluently
-
setEnableRangeSupport
- Parameters:
enableRangeSupport
- true to enable range support- Returns:
- a reference to this, so the API can be used fluently
-
setSendVaryHeader
- Parameters:
varyHeader
- true to sent vary header- Returns:
- a reference to this, so the API can be used fluently
-
setDefaultContentEncoding
- Parameters:
contentEncoding
- the desired content encoding e.g.: "UTF-8"- Returns:
- a reference to this, so the API can be used fluently
-
accept
- Specified by:
accept
in interfaceConsumer<RoutingContext>
-
newInstance
-