org.mortbay.http
public class PathMap extends HashMap implements Externalizable
/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
Note that this is a very different mapping to that provided by PathMap in Jetty2.
This class is not synchronized for get's. If concurrent modifications are possible then it should be synchronized at a higher level.
Version: $Id: PathMap.java,v 1.25 2005/08/13 00:01:24 gregwilkins Exp $
Constructor Summary | |
---|---|
PathMap() Construct empty PathMap. | |
PathMap(boolean nodefault) Construct empty PathMap. | |
PathMap(int capacity) Construct empty PathMap. | |
PathMap(Map m) Construct from dictionary PathMap. |
Method Summary | |
---|---|
void | clear() |
Entry | getMatch(String path) Get the entry mapped by the best specification. |
List | getMatches(String path) Get all entries matched by the path.
|
Object | match(String path) Get object matched by the path. |
static boolean | match(String pathSpec, String path) |
static boolean | match(String pathSpec, String path, boolean noDefault) |
static String | pathInfo(String pathSpec, String path) Return the portion of a path that is after a path spec. |
static String | pathMatch(String pathSpec, String path) Return the portion of a path that matches a path spec. |
Object | put(Object pathSpec, Object object) Add a single path match to the PathMap. |
void | readExternal(ObjectInput in) |
static String | relativePath(String base, String pathSpec, String path) Relative path. |
Object | remove(Object pathSpec) |
static void | setPathSpecSeparators(String s) Set the path spec separator.
|
void | writeExternal(ObjectOutput out) |
Parameters: path the path.
Returns: Map.Entry of the best matched or null.
Parameters: path Path to match
Returns: List of Map.Entry instances key=pathSpec
Parameters: path the path.
Returns: Best matched object or null.
Returns: true if match.
Returns: true if match.
Returns: The path info string
Returns: null if no match at all.
Parameters: pathSpec The path specification, or comma separated list of path specifications. object The object the path maps to
Parameters: base The base the path is relative to. pathSpec The spec of the path segment to ignore. path the additional path
Returns: base plus path with pathspec removed
Parameters: s separators