public class FilenameUtils extends FilenameUtils
Modifier and Type | Field and Description |
---|---|
static String[] |
OS_SPECIFIC_FILES
Names of OS-specific files.
|
static String[] |
OS_SPECIFIC_FOLDERS
Names of OS-specific folders.
|
EXTENSION_SEPARATOR, EXTENSION_SEPARATOR_STR
Modifier and Type | Method and Description |
---|---|
static boolean |
anyWildcardMatch(String[] filenames,
String wildcardMatcher,
IOCase caseSensitivity)
Checks if any of the entries in
filenames matches wildcardMatcher . |
static boolean |
isOSSpecificFile(String filename)
Checks if given argument
filename represents an OS-specific file/folder. |
static Collection<String> |
normalize(Collection<String> filenames)
Normalizes all entries of
filenames . |
static String |
replaceExtension(String fileName,
String ext) |
concat, directoryContains, equals, equals, equalsNormalized, equalsNormalizedOnSystem, equalsOnSystem, getBaseName, getExtension, getFullPath, getFullPathNoEndSeparator, getName, getPath, getPathNoEndSeparator, getPrefix, getPrefixLength, indexOfExtension, indexOfLastSeparator, isExtension, isExtension, isExtension, normalize, normalize, normalizeNoEndSeparator, normalizeNoEndSeparator, removeExtension, separatorsToSystem, separatorsToUnix, separatorsToWindows, wildcardMatch, wildcardMatch, wildcardMatchOnSystem
public static final String[] OS_SPECIFIC_FILES
public static final String[] OS_SPECIFIC_FOLDERS
public static boolean isOSSpecificFile(String filename)
filename
represents an OS-specific file/folder. A file/folder is deemed
OS-specific if:
OS_SPECIFIC_FOLDERS
OS_SPECIFIC_FILES
OS_SPECIFIC_FOLDERS
filename
can be in either Unix or Windows format and is additionally, normalized before the actual
check, so paths with single or double path steps are welcome.filename
- to checktrue
if filename
represents an OS-specific file; otherwise false
public static boolean anyWildcardMatch(String[] filenames, String wildcardMatcher, IOCase caseSensitivity)
filenames
matches wildcardMatcher
. Delegates individual entry
matching to FilenameUtils.wildcardMatch(String, String, IOCase)
.filenames
- the filenames to match onwildcardMatcher
- the wildcard string to match againstcaseSensitivity
- what case sensitivity rule to use, null means case-sensitivetrue
if any of the entries in filenames
matches wildcardMatcher
public static Collection<String> normalize(Collection<String> filenames)
filenames
. Delegates to FilenameUtils.normalize(String)
.filenames
- the filenames to normalize, null
returns null
null
whenever invalidFilenameUtils.normalize(String)
Copyright © 2020. All rights reserved.