public class WildcardMatcher extends Object
This method uses recursive matching, as in linux or windows. regexp works the same. This method is very fast, comparing to similar implementations.
| Modifier and Type | Field and Description |
|---|---|
protected static String |
PATH_MATCH |
protected static com.google.common.base.Splitter |
PATH_SPLITTER |
| Constructor and Description |
|---|
WildcardMatcher() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
match(CharSequence string,
CharSequence pattern)
Checks whether a string matches a given wildcard pattern.
|
static int |
matchOne(String src,
String... patterns)
Matches string to at least one pattern.
|
static boolean |
matchPath(String path,
String pattern)
Matches path against pattern using *, ? and ** wildcards.
|
static int |
matchPathOne(String platformDependentPath,
String... patterns)
Matches path to at least one pattern.
|
protected static boolean |
matchTokens(String[] tokens,
String[] patterns)
Match tokenized string and pattern.
|
protected static final String PATH_MATCH
protected static final com.google.common.base.Splitter PATH_SPLITTER
public static boolean match(CharSequence string, CharSequence pattern)
string - input stringpattern - pattern to matchtrue if string matches the pattern, otherwise falsepublic static int matchOne(String src, String... patterns)
-1 otherwise.match(CharSequence, CharSequence)public static int matchPathOne(String platformDependentPath, String... patterns)
-1 otherwise.#matchPath(String, String, char)public static boolean matchPath(String path, String pattern)
Copyright © 2018. All rights reserved.