|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hackystat.sensorbase.uripattern.PatternMatcher
public class PatternMatcher
A utility class which does pattern matches.
Constructor Summary | |
---|---|
PatternMatcher()
|
Method Summary | |
---|---|
(package private) static boolean |
matchesFilePath(java.lang.String pattern,
java.lang.String fileName,
boolean isCaseSensitive)
Determines whether a file name matches a pattern. |
static boolean |
matchesPattern(java.lang.String pattern,
java.lang.String str,
boolean caseSensitive)
Tests whether a string matches a pattern or not. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PatternMatcher()
Method Detail |
---|
static boolean matchesFilePath(java.lang.String pattern, java.lang.String fileName, boolean isCaseSensitive)
Some systems use slash, while others use back-slash as path separator. This function will not distinguish them (effectively,they are treated as the same character).
If a pattern ends with a path separator, then '**' will be append to it before matching. (i.e. if pattern is 'src/', then it will be treated as 'src/**'.
pattern
- The pattern. If null, then the method will always return true.fileName
- The file name to be tested against the pattern.isCaseSensitive
- Whether fileName is case sensitive.
public static boolean matchesPattern(java.lang.String pattern, java.lang.String str, boolean caseSensitive)
Note that this method is NOT designed to match file path, use
matchesFilePath
instead.
pattern
- The pattern. If null, the function always returns true.str
- The string to be matched against the pattern.caseSensitive
- Whether the matches is case sensitive or not.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |