| java.lang.Object org.springframework.util.AntPathMatcher
AntPathMatcher | public class AntPathMatcher implements PathMatcher(Code) | | PathMatcher implementation for Ant-style path patterns.
Examples are provided below.
Part of this mapping code has been kindly borrowed from
Apache Ant.
The mapping matches URLs using the following rules:
- ? matches one character
- * matches zero or more characters
- ** matches zero or more 'directories' in a path
Some examples:
com/t?st.jsp - matches com/test.jsp but also
com/tast.jsp or com/txst.jsp
com/*.jsp - matches all .jsp files in the
com directory
com/**/test.jsp - matches all test.jsp
files underneath the com path
org/springframework/**/*.jsp - matches all .jsp
files underneath the org/springframework path
org/**/servlet/bla.jsp - matches
org/springframework/servlet/bla.jsp but also
org/springframework/testing/servlet/bla.jsp and
org/servlet/bla.jsp
author: Alef Arendsen author: Juergen Hoeller author: Rob Harrop since: 16.07.2003 |
DEFAULT_PATH_SEPARATOR | final public static String DEFAULT_PATH_SEPARATOR(Code) | | Default path separator: "/"
|
extractPathWithinPattern | public String extractPathWithinPattern(String pattern, String path)(Code) | | Given a pattern and a full path, determine the pattern-mapped part.
For example:
- '
/docs/cvs/commit.html ' and '/docs/cvs/commit.html -> ''
- '
/docs/* ' and '/docs/cvs/commit -> 'cvs/commit '
- '
/docs/cvs/*.html ' and '/docs/cvs/commit.html -> 'commit.html '
- '
/docs/** ' and '/docs/cvs/commit -> 'cvs/commit '
- '
/docs/**\/*.html ' and '/docs/cvs/commit.html -> 'cvs/commit.html '
- '
/*.html ' and '/docs/cvs/commit.html -> 'docs/cvs/commit.html '
- '
*.html ' and '/docs/cvs/commit.html -> '/docs/cvs/commit.html '
- '
* ' and '/docs/cvs/commit.html -> '/docs/cvs/commit.html '
Assumes that
AntPathMatcher.match returns true for 'pattern '
and 'path ', but does not enforce this.
|
setPathSeparator | public void setPathSeparator(String pathSeparator)(Code) | | Set the path separator to use for pattern parsing.
Default is "/", as in Ant.
|
|
|