Class FilenameUtils
java.lang.Object
org.apache.mina.core.buffer.matcher.FilenameUtils
This class is extracted from Apache commons-io project
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String[]private static final intprivate static final charThe Unix separator character.private static final charThe Windows separator character. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static charflipSeparator(char ch) Flips the Windows name separator to Linux and vice-versa.(package private) static String[]splitOnTokens(String text) Splits a string into a number of tokens.static booleanwildcardMatch(String fileName, String wildcardMatcher, IOCase ioCase) Checks a fileName to see if it matches the specified wildcard matcher allowing control over case-sensitivity.
-
Field Details
-
NOT_FOUND
private static final int NOT_FOUND- See Also:
-
EMPTY_STRING_ARRAY
-
UNIX_NAME_SEPARATOR
private static final char UNIX_NAME_SEPARATORThe Unix separator character.- See Also:
-
WINDOWS_NAME_SEPARATOR
private static final char WINDOWS_NAME_SEPARATORThe Windows separator character.- See Also:
-
-
Constructor Details
-
FilenameUtils
public FilenameUtils()
-
-
Method Details
-
wildcardMatch
Checks a fileName to see if it matches the specified wildcard matcher allowing control over case-sensitivity.The wildcard matcher uses the characters '?' and '*' to represent a single or multiple (zero or more) wildcard characters. N.B. the sequence "*?" does not work properly at present in match strings.
- Parameters:
fileName- the fileName to match onwildcardMatcher- the wildcard string to match againstioCase- what case sensitivity rule to use, null means case-sensitive- Returns:
- true if the fileName matches the wildcard string
- Since:
- 1.3
-
splitOnTokens
Splits a string into a number of tokens. The text is split by '?' and '*'. Where multiple '*' occur consecutively they are collapsed into a single '*'.- Parameters:
text- the text to split- Returns:
- the array of tokens, never null
-
flipSeparator
static char flipSeparator(char ch) Flips the Windows name separator to Linux and vice-versa.- Parameters:
ch- The Windows or Linux name separator.- Returns:
- The Windows or Linux name separator.
-