Class ResourceHandler
java.lang.Object
io.undertow.server.handlers.resource.ResourceHandler
- All Implemented Interfaces:
HttpHandler
- Author:
- Stuart Douglas
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.ResourceHandler
(ResourceManager resourceSupplier) ResourceHandler
(ResourceManager resourceManager, HttpHandler next) ResourceHandler
(ResourceSupplier resourceSupplier) ResourceHandler
(ResourceSupplier resourceManager, HttpHandler next) -
Method Summary
Modifier and TypeMethodDescriptionaddWelcomeFiles
(String... files) void
handleRequest
(HttpServerExchange exchange) Handle the request.boolean
boolean
setAllowed
(Predicate allowed) setCachable
(Predicate cachable) setCacheTime
(Integer cacheTime) void
setCanonicalizePaths
(boolean canonicalizePaths) If this handler should use canonicalized paths.setContentEncodedResourceManager
(ContentEncodedResourceManager contentEncodedResourceManager) setDirectoryListingEnabled
(boolean directoryListingEnabled) setMimeMappings
(MimeMappings mimeMappings) setResourceManager
(ResourceManager resourceManager) setResourceSupplier
(ResourceSupplier resourceSupplier) setWelcomeFiles
(String... files)
-
Constructor Details
-
ResourceHandler
-
ResourceHandler
-
ResourceHandler
-
ResourceHandler
-
ResourceHandler
Deprecated.You should useResourceHandler(io.undertow.server.handlers.resource.ResourceManager)
instead.
-
-
Method Details
-
handleRequest
Description copied from interface:HttpHandler
Handle the request.- Specified by:
handleRequest
in interfaceHttpHandler
- Parameters:
exchange
- the HTTP request/response exchange- Throws:
Exception
-
isDirectoryListingEnabled
public boolean isDirectoryListingEnabled() -
setDirectoryListingEnabled
-
addWelcomeFiles
-
setWelcomeFiles
-
getMimeMappings
-
setMimeMappings
-
getCachable
-
setCachable
-
getAllowed
-
setAllowed
-
getResourceSupplier
-
setResourceSupplier
-
getResourceManager
-
setResourceManager
-
getCacheTime
-
setCacheTime
-
getContentEncodedResourceManager
-
setContentEncodedResourceManager
public ResourceHandler setContentEncodedResourceManager(ContentEncodedResourceManager contentEncodedResourceManager) -
isCanonicalizePaths
public boolean isCanonicalizePaths() -
setCanonicalizePaths
public void setCanonicalizePaths(boolean canonicalizePaths) If this handler should use canonicalized paths. WARNING: If this is not true andCanonicalPathHandler
is not installed in the handler chain then is may be possible to perform a directory traversal attack. If you set this to false make sure you have some kind of check in place to control the path.- Parameters:
canonicalizePaths
- If paths should be canonicalized
-