org.springframework.util
Class PathMatcher
- public abstract class PathMatcher
Utility for matching paths with patterns in an Ant-like way.
Examples are provided below. Part of this mapping code has been
kindly borrowed from Ant (http://ant.apache.org).
The mapping matches urls using the following rules:
- '*' matches zero or more characters
- '?' matches one characters
- ** matches zero or more 'directories' in a path
Some examples:
- com/**\/test.jsp - matches all test.jsp path underneath the com path
- org/springframework/**\/*.jsp - matches all .jsp files underneath the
org/springframework path
- com/t?st.jsp - matches test.jsp but also tast.jsp or txst.jsp
- com/**\/servlet/bla.jsp - matches org/springframework/servlet/bla.jsp but
also org/springframework/testing/servlet/bla.jsp and com/servlet/bla.jsp
- Author:
- Alef Arendsen
| Method Summary |
static boolean | match(String pattern, String str) Matches a strign agains the given pattern |
match
public static boolean match(String pattern, String str)
- Matches a strign agains the given pattern
- Parameters:
- pattern - the pattern to match against
- str - the string to test
- Returns:
true is the arguments matched, false
otherwise