Package org.apache.tomcat.util.file
Class Matcher
java.lang.Object
org.apache.tomcat.util.file.Matcher
This is a utility class to match file globs. The class has been derived from org.apache.tools.ant.types.selectors.SelectorUtils.
All methods are static.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
Tests whether or not a string matches against a pattern.static boolean
Tests whether or not a given file name matches any file name pattern in the given set.
-
Constructor Details
-
Matcher
public Matcher()
-
-
Method Details
-
matchName
Tests whether or not a given file name matches any file name pattern in the given set. The match is performed case-sensitively.- Parameters:
patternSet
- The pattern set to match against. Must not benull
.fileName
- The file name to match, as a String. Must not benull
. It must be just a file name, without a path.- Returns:
true
if any pattern in the set matches against the file name, orfalse
otherwise.- See Also:
-
match
Tests whether or not a string matches against a pattern. The pattern may contain two special characters:
'*' means zero or more characters
'?' means one and only one character- Parameters:
pattern
- The pattern to match against. Must not benull
.str
- The string which must be matched against the pattern. Must not benull
.caseSensitive
- Whether or not matching should be performed case sensitively.- Returns:
true
if the string matches against the pattern, orfalse
otherwise.
-