Class FilenameUtils
- java.lang.Object
-
- org.apache.mina.core.buffer.matcher.FilenameUtils
-
public class FilenameUtils extends java.lang.ObjectThis class is extracted from Apache commons-io project
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String[]EMPTY_STRING_ARRAYprivate static intNOT_FOUNDprivate static charUNIX_NAME_SEPARATORThe Unix separator character.private static charWINDOWS_NAME_SEPARATORThe Windows separator character.
-
Constructor Summary
Constructors Constructor Description FilenameUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static charflipSeparator(char ch)Flips the Windows name separator to Linux and vice-versa.(package private) static java.lang.String[]splitOnTokens(java.lang.String text)Splits a string into a number of tokens.static booleanwildcardMatch(java.lang.String fileName, java.lang.String wildcardMatcher, IOCase ioCase)Checks a fileName to see if it matches the specified wildcard matcher allowing control over case-sensitivity.
-
-
-
Field Detail
-
NOT_FOUND
private static final int NOT_FOUND
- See Also:
- Constant Field Values
-
EMPTY_STRING_ARRAY
private static final java.lang.String[] EMPTY_STRING_ARRAY
-
UNIX_NAME_SEPARATOR
private static final char UNIX_NAME_SEPARATOR
The Unix separator character.- See Also:
- Constant Field Values
-
WINDOWS_NAME_SEPARATOR
private static final char WINDOWS_NAME_SEPARATOR
The Windows separator character.- See Also:
- Constant Field Values
-
-
Method Detail
-
wildcardMatch
public static boolean wildcardMatch(java.lang.String fileName, java.lang.String wildcardMatcher, IOCase ioCase)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
static java.lang.String[] splitOnTokens(java.lang.String text)
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.
-
-