Package org.apache.felix.gogo.runtime
Class GlobPathMatcher
java.lang.Object
org.apache.felix.gogo.runtime.GlobPathMatcher
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 -
Constructor Summary
ConstructorsConstructorDescriptionGlobPathMatcher
(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
-
Field Details
-
DEFAULT_PATH_SEPARATOR
Default path separator: "/"- See Also:
-
-
Constructor Details
-
GlobPathMatcher
Create a new instance with theDEFAULT_PATH_SEPARATOR
.- Parameters:
pattern
- the pattern
-
GlobPathMatcher
A convenient, alternative constructor to use with a custom path separator.- Parameters:
pattern
- the patternpathSeparator
- the path separator to use, must not benull
.caseSensitive
- is case sensitive
-
-
Method Details
-
matches
Actually match the givenpath
against 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:
true
if the suppliedpath
matched,false
if it didn't
-