Package org.apache.felix.gogo.runtime
Class GlobPathMatcher
- java.lang.Object
-
- org.apache.felix.gogo.runtime.GlobPathMatcher
-
public class GlobPathMatcher extends Object
Freely adapted from Spring's AntPathMatcher. We don't use the file system's glob PathMatcher because it can't detect directories which can't be a start of a match.
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_PATH_SEPARATORDefault path separator: "/"
-
Constructor Summary
Constructors Constructor Description GlobPathMatcher(String pattern)Create a new instance with theDEFAULT_PATH_SEPARATOR.GlobPathMatcher(String pattern, String pathSeparator, boolean caseSensitive)A convenient, alternative constructor to use with a custom path separator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanmatches(String path, boolean fullMatch)Actually match the givenpathagainst the givenpattern.
-
-
-
Field Detail
-
DEFAULT_PATH_SEPARATOR
public static final String DEFAULT_PATH_SEPARATOR
Default path separator: "/"- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GlobPathMatcher
public GlobPathMatcher(String pattern)
Create a new instance with theDEFAULT_PATH_SEPARATOR.
-
-
Method Detail
-
matches
public boolean matches(String path, boolean fullMatch)
Actually match the givenpathagainst the givenpattern.- Parameters:
path- the path String to testfullMatch- whether a full pattern match is required (else a pattern match as far as the given base path goes is sufficient)- Returns:
trueif the suppliedpathmatched,falseif it didn't
-
-