|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.AbstractMap | +--java.util.HashMap | +--org.mortbay.http.PathMap
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
Note that this is a very different mapping to that provided by PathMap in Jetty2.
Inner classes inherited from class java.util.Map |
java.util.Map.Entry |
Constructor Summary | |
PathMap()
Construct empty PathMap. |
|
PathMap(int capacity)
Construct empty PathMap. |
|
PathMap(java.util.Map m)
Construct from dictionary PathMap. |
Method Summary | |
void |
clear()
|
java.util.Map.Entry |
getMatch(java.lang.String path)
Get the entry mapped by the best specification. |
java.util.List |
getMatches(java.lang.String path)
Get all entries matched by the path. |
java.lang.Object |
match(java.lang.String path)
Get object matched by the path. |
static boolean |
match(java.lang.String pathSpec,
java.lang.String path)
|
static java.lang.String |
pathInfo(java.lang.String pathSpec,
java.lang.String path)
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)
Return the portion of a path that matches a path spec. |
java.lang.Object |
put(java.lang.Object pathSpec,
java.lang.Object object)
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)
Relative path. |
java.lang.Object |
remove(java.lang.Object pathSpec)
|
static void |
setPathSpecSeparators(java.lang.String s)
Set the path spec separator. |
Methods inherited from class java.util.HashMap |
clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, putAll, size, values |
Methods inherited from class java.util.AbstractMap |
equals, hashCode, toString |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
equals, hashCode |
Constructor Detail |
public PathMap()
public PathMap(int capacity)
public PathMap(java.util.Map m)
Method Detail |
public static void setPathSpecSeparators(java.lang.String s)
s
- separatorspublic java.lang.Object put(java.lang.Object pathSpec, java.lang.Object object)
put
in class java.util.HashMap
pathSpec
- The path specification, or coma separated list of
path specifications.object
- The object the path maps topublic java.lang.Object match(java.lang.String path)
path
- the path.public java.util.Map.Entry getMatch(java.lang.String path)
path
- the path.public java.util.List getMatches(java.lang.String path)
path
- Path to matchpublic java.lang.Object remove(java.lang.Object pathSpec)
remove
in class java.util.HashMap
public void clear()
clear
in class java.util.HashMap
public static boolean match(java.lang.String pathSpec, java.lang.String path) throws java.lang.IllegalArgumentException
public static java.lang.String pathMatch(java.lang.String pathSpec, java.lang.String path)
public static java.lang.String pathInfo(java.lang.String pathSpec, java.lang.String path)
public 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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |