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.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private static boolean | |
| private static boolean | |
| public static boolean | Returns: true if the string matches against the pattern,
or false otherwise.The pattern to match against.
Must not be pattern, String null.The string which must be matched against the
pattern. Must not be str, boolean null.Whether or not matching should be performed
case sensitively. caseSensitive)Tests whether or not a string matches against a pattern. |
| private static boolean | Returns: true if the string matches against the pattern,
or false otherwise.The pattern to match against.
Must not be pattern, char[] null.The character array which must be matched against the
pattern. Must not be strArr, boolean null.Whether or not matching should be performed
case sensitively. caseSensitive)Tests whether or not a string matches against a pattern. |
| public static boolean | Returns: true if any pattern in the set matches against the
file name, or false otherwise.The pattern set to match against. Must not be
patternSet, String null.The file name to match, as a String. Must not be
fileName, boolean null. It must be just a file name, without
a path.Whether or not matching should be performed
case sensitively. caseSensitive)Tests whether or not a given file name matches any file name pattern in the given set. |
| GlobMatcher | back to summary |
|---|---|
| public GlobMatcher() Construct the matcher. | |
| allStars | back to summary |
|---|---|
| private static boolean allStars(char[] chars, int start, int end) | |
| different | back to summary |
|---|---|
| private static boolean different(boolean caseSensitive, char ch, char other) | |
| match | back to summary |
|---|---|
| public static boolean match(String pattern, String str, boolean caseSensitive) Tests whether or not a string matches against a pattern.
The pattern may contain two special characters:
| |
| match | back to summary |
|---|---|
| private static boolean match(String pattern, char[] strArr, boolean caseSensitive) Tests whether or not a string matches against a pattern.
The pattern may contain two special characters:
| |
| matchName | back to summary |
|---|---|
| public static boolean matchName(Set<String> patternSet, String fileName, boolean caseSensitive) Tests whether or not a given file name matches any file name pattern in the given set. The match is performed case-sensitively.
| |