public class ResourceHandler extends Object implements HttpHandler
| Modifier and Type | Class and Description |
|---|---|
static class |
ResourceHandler.Builder |
| Constructor and Description |
|---|
ResourceHandler()
Deprecated.
|
ResourceHandler(ResourceManager resourceSupplier) |
ResourceHandler(ResourceManager resourceManager,
HttpHandler next) |
ResourceHandler(ResourceSupplier resourceSupplier) |
ResourceHandler(ResourceSupplier resourceManager,
HttpHandler next) |
| Modifier and Type | Method and Description |
|---|---|
ResourceHandler |
addWelcomeFiles(String... files) |
Predicate |
getAllowed() |
MimeMappings |
getMimeMappings() |
ResourceManager |
getResourceManager() |
ResourceSupplier |
getResourceSupplier() |
void |
handleRequest(HttpServerExchange exchange)
Handle the request.
|
boolean |
isCanonicalizePaths() |
boolean |
isDirectoryListingEnabled() |
ResourceHandler |
setAllowed(Predicate allowed) |
void |
setCanonicalizePaths(boolean canonicalizePaths)
If this handler should use canonicalized paths.
|
ResourceHandler |
setDirectoryListingEnabled(boolean directoryListingEnabled) |
ResourceHandler |
setMimeMappings(MimeMappings mimeMappings) |
ResourceHandler |
setResourceManager(ResourceManager resourceManager) |
ResourceHandler |
setResourceSupplier(ResourceSupplier resourceSupplier) |
ResourceHandler |
setWelcomeFiles(String... files) |
public ResourceHandler(ResourceManager resourceSupplier)
public ResourceHandler(ResourceManager resourceManager, HttpHandler next)
public ResourceHandler(ResourceSupplier resourceSupplier)
public ResourceHandler(ResourceSupplier resourceManager, HttpHandler next)
@Deprecated public ResourceHandler()
ResourceHandler(ResourceManager) instead.public void handleRequest(HttpServerExchange exchange) throws Exception
HttpHandlerhandleRequest in interface HttpHandlerexchange - the HTTP request/response exchangeExceptionpublic boolean isDirectoryListingEnabled()
public ResourceHandler setDirectoryListingEnabled(boolean directoryListingEnabled)
public ResourceHandler addWelcomeFiles(String... files)
public ResourceHandler setWelcomeFiles(String... files)
public MimeMappings getMimeMappings()
public ResourceHandler setMimeMappings(MimeMappings mimeMappings)
public Predicate getAllowed()
public ResourceHandler setAllowed(Predicate allowed)
public ResourceSupplier getResourceSupplier()
public ResourceHandler setResourceSupplier(ResourceSupplier resourceSupplier)
public ResourceManager getResourceManager()
public ResourceHandler setResourceManager(ResourceManager resourceManager)
public boolean isCanonicalizePaths()
public void setCanonicalizePaths(boolean canonicalizePaths)
WARNING: If this is not true and CanonicalPathHandler 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.
canonicalizePaths - If paths should be canonicalizedCopyright © 2020 JBoss by Red Hat. All rights reserved.