| java.util.HashMap org.mortbay.jetty.servlet.PathMap
PathMap | public class PathMap extends HashMap implements Externalizable(Code) | | URI path map to Object.
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.
Matching is performed in the following order
Exact match.
Longest prefix match.
Longest suffix match.
default.
Multiple path specifications can be mapped by providing a list of
specifications. The list is separated by the characters specified
in the "org.mortbay.http.PathMap.separators" System property, which
defaults to :
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 for get's. If concurrent modifications are
possible then it should be synchronized at a higher level.
author: Greg Wilkins (gregw) |
Inner Class :public static class Entry implements Map.Entry | |
Constructor Summary | |
public | PathMap() Construct empty PathMap. | public | PathMap(boolean nodefault) Construct empty PathMap. | public | PathMap(int capacity) Construct empty PathMap. | public | PathMap(Map m) Construct from dictionary PathMap. |
_defaultSingletonList | List _defaultSingletonList(Code) | | |
_nodefault | boolean _nodefault(Code) | | |
_prefixDefault | Entry _prefixDefault(Code) | | |
PathMap | public PathMap()(Code) | | Construct empty PathMap.
|
PathMap | public PathMap(boolean nodefault)(Code) | | Construct empty PathMap.
|
PathMap | public PathMap(int capacity)(Code) | | Construct empty PathMap.
|
PathMap | public PathMap(Map m)(Code) | | Construct from dictionary PathMap.
|
clear | public void clear()(Code) | | |
getLazyMatches | public Object getLazyMatches(String path)(Code) | | Get all entries matched by the path.
Best match first.
Parameters: path - Path to match LazyList of Map.Entry instances key=pathSpec |
getMatch | public Entry getMatch(String path)(Code) | | Get the entry mapped by the best specification.
Parameters: path - the path. Map.Entry of the best matched or null. |
getMatches | public List getMatches(String path)(Code) | | Get all entries matched by the path.
Best match first.
Parameters: path - Path to match List of Map.Entry instances key=pathSpec |
match | public Object match(String path)(Code) | | Get object matched by the path.
Parameters: path - the path. Best matched object or null. |
pathInfo | public static String pathInfo(String pathSpec, String path)(Code) | | Return the portion of a path that is after a path spec.
The path info string |
pathMatch | public static String pathMatch(String pathSpec, String path)(Code) | | Return the portion of a path that matches a path spec.
null if no match at all. |
put | public synchronized Object put(Object pathSpec, Object object)(Code) | | Add a single path match to the PathMap.
Parameters: pathSpec - The path specification, or comma separated list ofpath specifications. Parameters: object - The object the path maps to |
relativePath | public static String relativePath(String base, String pathSpec, String path)(Code) | | Relative path.
Parameters: base - The base the path is relative to. Parameters: pathSpec - The spec of the path segment to ignore. Parameters: path - the additional path base plus path with pathspec removed |
setPathSpecSeparators | public static void setPathSpecSeparators(String s)(Code) | | Set the path spec separator.
Multiple path specification may be included in a single string
if they are separated by the characters set in this string.
The default value is ":," or whatever has been set by the
system property org.mortbay.http.PathMap.separators
Parameters: s - separators |
|
|