O
- the Map.Entry value typePathMappings
(this class will be removed in Jetty 10)@Deprecated
public class PathMap<O>
extends java.util.HashMap<java.lang.String,O>
This mapping implements the path specification recommended in the 2.2 Servlet API.
Path specifications can be of the following forms:
/foo/bar - an exact path specification. /foo/* - a prefix path specification (must end '/*'). *.ext - a suffix path specification. / - the default path specification. "" - the / path specificationMatching is performed in the following order
Multiple path specifications can be mapped by providing a list of specifications. By default this class uses characters ":," as path separators, unless configured differently by calling the static method @see PathMap#setPathSpecSeparators(String)
Special characters within paths such as '?� and ';' are not treated specially as it is assumed they would have been either encoded in the original URL or stripped from the path.
This class is not synchronized. If concurrent modifications are possible then it should be synchronized at a higher level.
Modifier and Type | Class and Description |
---|---|
static class |
PathMap.MappedEntry<O>
Deprecated.
|
static class |
PathMap.PathSet
Deprecated.
|
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
__pathSpecSeparators
Deprecated.
|
(package private) PathMap.MappedEntry<O> |
_default
Deprecated.
|
(package private) java.util.List<PathMap.MappedEntry<O>> |
_defaultSingletonList
Deprecated.
|
(package private) java.util.Map<java.lang.String,PathMap.MappedEntry<O>> |
_exactMap
Deprecated.
|
(package private) boolean |
_nodefault
Deprecated.
|
(package private) PathMap.MappedEntry<O> |
_prefixDefault
Deprecated.
|
(package private) Trie<PathMap.MappedEntry<O>> |
_prefixMap
Deprecated.
|
(package private) Trie<PathMap.MappedEntry<O>> |
_suffixMap
Deprecated.
|
Modifier | Constructor and Description |
---|---|
|
PathMap()
Deprecated.
|
|
PathMap(boolean noDefault)
Deprecated.
|
|
PathMap(int capacity)
Deprecated.
|
private |
PathMap(int capacity,
boolean noDefault)
Deprecated.
|
|
PathMap(java.util.Map<java.lang.String,? extends O> dictMap)
Deprecated.
Construct from dictionary PathMap.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Deprecated.
|
boolean |
containsMatch(java.lang.String path)
Deprecated.
Return whether the path matches any entries in the PathMap,
excluding the default entry
|
PathMap.MappedEntry<O> |
getMatch(java.lang.String path)
Deprecated.
Get the entry mapped by the best specification.
|
java.util.List<? extends java.util.Map.Entry<java.lang.String,O>> |
getMatches(java.lang.String path)
Deprecated.
Get all entries matched by the path.
|
private static boolean |
isPathWildcardMatch(java.lang.String pathSpec,
java.lang.String path)
Deprecated.
|
O |
match(java.lang.String path)
Deprecated.
Get object matched by the path.
|
static boolean |
match(java.lang.String pathSpec,
java.lang.String path)
Deprecated.
|
static boolean |
match(java.lang.String pathSpec,
java.lang.String path,
boolean noDefault)
Deprecated.
|
static java.lang.String |
pathInfo(java.lang.String pathSpec,
java.lang.String path)
Deprecated.
Return the portion of a path that is after a path spec.
|
static java.lang.String |
pathMatch(java.lang.String pathSpec,
java.lang.String path)
Deprecated.
Return the portion of a path that matches a path spec.
|
O |
put(java.lang.String pathSpec,
O object)
Deprecated.
Add a single path match to the PathMap.
|
static java.lang.String |
relativePath(java.lang.String base,
java.lang.String pathSpec,
java.lang.String path)
Deprecated.
Relative path.
|
O |
remove(java.lang.Object pathSpec)
Deprecated.
|
static void |
setPathSpecSeparators(java.lang.String s)
Deprecated.
Set the path spec separator.
|
clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, putAll, putIfAbsent, remove, replace, replace, replaceAll, size, values
private static java.lang.String __pathSpecSeparators
Trie<PathMap.MappedEntry<O>> _prefixMap
Trie<PathMap.MappedEntry<O>> _suffixMap
final java.util.Map<java.lang.String,PathMap.MappedEntry<O>> _exactMap
java.util.List<PathMap.MappedEntry<O>> _defaultSingletonList
PathMap.MappedEntry<O> _prefixDefault
PathMap.MappedEntry<O> _default
boolean _nodefault
public PathMap()
public PathMap(boolean noDefault)
public PathMap(int capacity)
private PathMap(int capacity, boolean noDefault)
public PathMap(java.util.Map<java.lang.String,? extends O> dictMap)
dictMap
- the map representing the dictionary to build this PathMap frompublic static void setPathSpecSeparators(java.lang.String s)
s
- separatorspublic O put(java.lang.String pathSpec, O object)
public O match(java.lang.String path)
path
- the path.public PathMap.MappedEntry<O> getMatch(java.lang.String path)
path
- the path.public java.util.List<? extends java.util.Map.Entry<java.lang.String,O>> getMatches(java.lang.String path)
path
- Path to matchpublic boolean containsMatch(java.lang.String path)
path
- Path to matchpublic O remove(java.lang.Object pathSpec)
public void clear()
public static boolean match(java.lang.String pathSpec, java.lang.String path)
pathSpec
- the path specpath
- the pathpublic static boolean match(java.lang.String pathSpec, java.lang.String path, boolean noDefault)
pathSpec
- the path specpath
- the pathnoDefault
- true to not handle the default path "/" special, false to allow matcher rules to runprivate static boolean isPathWildcardMatch(java.lang.String pathSpec, java.lang.String path)
public static java.lang.String pathMatch(java.lang.String pathSpec, java.lang.String path)
pathSpec
- the path specpath
- the pathpublic static java.lang.String pathInfo(java.lang.String pathSpec, java.lang.String path)
pathSpec
- the path specpath
- the pathpublic static java.lang.String relativePath(java.lang.String base, java.lang.String pathSpec, java.lang.String path)
base
- The base the path is relative to.pathSpec
- The spec of the path segment to ignore.path
- the additional path