public final class WildCard extends Object
The WildCard class may be used to check Strings against a wildcard pattern using the SMB/CIFS wildcard rules.
A number of static convenience methods are also provided.
Modifier and Type | Field and Description |
---|---|
static int |
DOT_UNICODE_WILDCARD |
static int |
MULTICHAR_UNICODE_WILDCARD |
static int |
MULTICHAR_WILDCARD |
static int |
SINGLECHAR_UNICODE_WILDCARD |
static int |
SINGLECHAR_WILDCARD |
static int |
WILDCARD_ALL |
static int |
WILDCARD_COMPLEX |
static int |
WILDCARD_EXT |
static int |
WILDCARD_INVALID |
static int |
WILDCARD_NAME |
static int |
WILDCARD_NONE |
Constructor and Description |
---|
WildCard()
Default constructor
|
WildCard(String pattern,
boolean caseSensitive)
Class constructor
|
Modifier and Type | Method and Description |
---|---|
static boolean |
containsUnicodeWildcard(String str)
Check if a string contains any of the Unicode wildcard characters
|
static boolean |
containsWildcards(String str)
Check if the string contains any wildcard characters.
|
static String |
convertToRegexp(String path)
Convert a wildcard string to a regular expression
|
static String |
convertUnicodeWildcardToDOS(String str)
Convert the Unicode wildcard string to a standard DOS wildcard string
|
String |
getMatchPart()
Return the match part for wildcard name and wildcard extension type patterns
|
String |
getPattern()
Return the wildcard pattern string
|
boolean |
isCaseSensitive()
Check if case sensitive matching is enabled
|
int |
isType()
Return the wildcard pattern type
|
static boolean |
isWildcardAll(String srchPath)
Check if a search path is a full wildcard search
|
protected boolean |
matchComplexWildcard(String str)
Match a complex wildcard pattern with the specified string
|
boolean |
matchesPattern(String str)
Determine if the string matches the wildcard pattern
|
void |
setPattern(String pattern,
boolean caseSensitive)
Set the wildcard pattern string
|
String |
toString()
Return the wildcard as a string
|
public static final int MULTICHAR_WILDCARD
public static final int SINGLECHAR_WILDCARD
public static final int SINGLECHAR_UNICODE_WILDCARD
public static final int DOT_UNICODE_WILDCARD
public static final int MULTICHAR_UNICODE_WILDCARD
public static final int WILDCARD_NONE
public static final int WILDCARD_ALL
public static final int WILDCARD_NAME
public static final int WILDCARD_EXT
public static final int WILDCARD_COMPLEX
public static final int WILDCARD_INVALID
public WildCard()
public WildCard(String pattern, boolean caseSensitive)
pattern
- StringcaseSensitive
- booleanpublic final int isType()
public final boolean isCaseSensitive()
public final String getPattern()
public final String getMatchPart()
public final boolean matchesPattern(String str)
str
- Stringprotected final boolean matchComplexWildcard(String str)
str
- Stringpublic final void setPattern(String pattern, boolean caseSensitive)
pattern
- StringcaseSensitive
- booleanpublic String toString()
public static final boolean containsWildcards(String str)
str
- java.lang.Stringpublic static final boolean containsUnicodeWildcard(String str)
str
- Stringpublic static final String convertUnicodeWildcardToDOS(String str)
str
- Stringpublic static final String convertToRegexp(String path)
path
- Stringpublic static final boolean isWildcardAll(String srchPath)
srchPath
- StringCopyright © 2005–2017 Alfresco Software. All rights reserved.