public class PathHandler extends Object implements HttpHandler
Constructor and Description |
---|
PathHandler() |
PathHandler(HttpHandler defaultHandler) |
Modifier and Type | Method and Description |
---|---|
PathHandler |
addExactPath(String path,
HttpHandler handler)
If the request path is exactly equal to the given path, run the handler.
|
PathHandler |
addPath(String path,
HttpHandler handler)
Deprecated.
Superseded by
#addPrefixPath() . |
PathHandler |
addPrefixPath(String path,
HttpHandler handler)
Adds a path prefix and a handler for that path.
|
PathHandler |
clearPaths() |
void |
handleRequest(HttpServerExchange exchange)
Handle the request.
|
PathHandler |
removeExactPath(String path) |
PathHandler |
removePath(String path)
Deprecated.
|
PathHandler |
removePrefixPath(String path) |
public PathHandler(HttpHandler defaultHandler)
public PathHandler()
public void handleRequest(HttpServerExchange exchange) throws Exception
HttpHandler
handleRequest
in interface HttpHandler
exchange
- the HTTP request/response exchangeException
@Deprecated public PathHandler addPath(String path, HttpHandler handler)
#addPrefixPath()
.path
- The pathhandler
- The handleraddPrefixPath(String, io.undertow.server.HttpHandler)
public PathHandler addPrefixPath(String path, HttpHandler handler)
path
- If the request contains this prefix, run handler.handler
- The handler which is activated upon match.public PathHandler addExactPath(String path, HttpHandler handler)
path
- If the request path is exactly this, run handler.handler
- Handler run upon exact path match.@Deprecated public PathHandler removePath(String path)
public PathHandler removePrefixPath(String path)
public PathHandler removeExactPath(String path)
public PathHandler clearPaths()
Copyright © 2014 JBoss by Red Hat. All rights reserved.