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 | Description |
---|---|---|
static class |
PathMap.MappedEntry<O> |
Deprecated.
|
static class |
PathMap.PathSet |
Deprecated.
|
Constructor | Description |
---|---|
PathMap() |
Deprecated.
|
PathMap(boolean noDefault) |
Deprecated.
|
PathMap(int capacity) |
Deprecated.
|
PathMap(java.util.Map<java.lang.String,? extends O> dictMap) |
Deprecated.
Construct from dictionary PathMap.
|
Modifier and Type | Method | 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.
|
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
public PathMap()
public PathMap(boolean noDefault)
public PathMap(int capacity)
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)
put
in class java.util.HashMap<java.lang.String,O>
pathSpec
- The path specification, or comma separated list of
path specifications.object
- The object the path maps topublic 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)
remove
in class java.util.HashMap<java.lang.String,O>
public void clear()
clear
in class java.util.HashMap<java.lang.String,O>
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 runpublic 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 pathCopyright © 1995–2017 Webtide. All rights reserved.