Package io.undertow.util
Class PathMatcher<T>
java.lang.Object
io.undertow.util.PathMatcher<T>
Handler that dispatches to a given handler based of a prefix match of the path.
This only matches a single level of a request, e.g if you have a request that takes the form:
/foo/bar
- Author:
- Stuart Douglas
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddExactPath
(String path, T handler) addPrefixPath
(String path, T handler) Adds a path prefix and a handler for that path.getExactPath
(String path) getPaths()
getPrefixPath
(String path) Matches a path against the registered handlers.removeExactPath
(String path) removePath
(String path) Deprecated.removePrefixPath
(String path)
-
Constructor Details
-
PathMatcher
-
PathMatcher
public PathMatcher()
-
-
Method Details
-
getExactPathMatchesSet
-
getPathMatchesSet
-
match
Matches a path against the registered handlers.- Parameters:
path
- The relative path to match- Returns:
- The match match. This will never be null, however if none matched its value field will be
-
addPrefixPath
Adds a path prefix and a handler for that path. If the path does not start with a / then one will be prepended.The match is done on a prefix bases, so registering /foo will also match /foo/bar. Exact path matches are taken into account first.
If / is specified as the path then it will replace the default handler.
- Parameters:
path
- The pathhandler
- The handler
-
addExactPath
-
getExactPath
-
getPrefixPath
-
removePath
Deprecated. -
removePrefixPath
-
removeExactPath
-
clearPaths
-
getPaths
-