|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.aeonscope.io.FileKit
public class FileKit
General utilities for file manipulation.
| Constructor Summary | |
|---|---|
FileKit()
|
|
| Method Summary | |
|---|---|
static boolean |
doesExist(File file)
Determines if a given file exists on a file system. |
static boolean |
doesExist(String path)
Determines if a given file path exists on a file system. |
static String |
getMD5Sum(File file)
Answers the MD5, 32-character hex checksum based on a file. |
static String |
getMD5Sum(String path)
Answers the MD5, 32-character hex checksum based on a file path. |
static Collection |
listDirectories(File file)
Answers a list of directories for the given file. |
static Collection |
listDirectories(String path)
Answers a list of directories for the given path. |
static Collection<?> |
listFilesWithIOFileFilter(String path,
org.apache.commons.io.filefilter.IOFileFilter filter,
boolean isRecursive)
Obtains a list of files that match a given suffix with the option to recurse a directory structure. |
static Collection<?> |
listFilesWithPrefix(String path,
String prefix,
boolean isRecursive)
List files that match a given prefix with the option for directory recursion. |
static Collection<?> |
listFilesWithPrefixes(String path,
String[] prefixes,
boolean isRecursive)
List files that match an array of prefixes with the option for directory recursion. |
static Collection<?> |
listFilesWithSuffix(String path,
String suffix,
boolean isRecursive)
List files that match a given suffix with the option for directory recursion. |
static Collection<?> |
listFilesWithSuffixes(String path,
String[] suffixes,
boolean isRecursive)
List files that match a suffix array with the option for directory recursion. |
static String |
reparent(String sourcePath,
String sourceRootPath,
String targetRootPath)
Re-parents a path (case sensitive) by switching the source root path with the target root path. |
static String |
separatorsToSystemWithNoEndSeparator(String path)
Convert all separators to system separators and removes the trailing separator (if found). |
static String |
separatorsToSystemWithNoOuterSeparators(String path)
Convert all separators to system separators and removes separators found before and after the path (if any). |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileKit()
| Method Detail |
|---|
public static boolean doesExist(String path)
path - The file path to validate.
public static boolean doesExist(File file)
file - The file to validate.
public static Collection listDirectories(String path)
path - The path to search.
public static Collection listDirectories(File file)
file - The file to search.
public static Collection<?> listFilesWithPrefix(String path,
String prefix,
boolean isRecursive)
path - The root path to search.prefix - The prefix used to determine a file match.isRecursive - true = traverse the root path and all
sub-directories, false = traverse the root path
only.
public static Collection<?> listFilesWithPrefixes(String path,
String[] prefixes,
boolean isRecursive)
path - The root path to search.prefixes - The prefix array used to determine a file match.isRecursive - true = traverse the root path and all
sub-directories, false = traverse the root path
only.
public static Collection<?> listFilesWithSuffix(String path,
String suffix,
boolean isRecursive)
path - The root path to search.suffix - The suffix used to determine a file match.isRecursive - true = traverse the root path and all
sub-directories, false = traverse the root path
only.
public static Collection<?> listFilesWithSuffixes(String path,
String[] suffixes,
boolean isRecursive)
path - The root path to search.suffixes - The suffix array used to determine a file match.isRecursive - true = traverse the root path and all
sub-directories, false = traverse the root path
only.
public static Collection<?> listFilesWithIOFileFilter(String path,
org.apache.commons.io.filefilter.IOFileFilter filter,
boolean isRecursive)
path - The root path to search.filter - The file filter used to determine a file match.isRecursive - true = traverse the root path and all
sub-directories, false = traverse the root
path only.
public static String reparent(String sourcePath,
String sourceRootPath,
String targetRootPath)
sourcePath - The path to re-parent.sourceRootPath - The root path of the source path.targetRootPath - The root path of the target path.
public static String separatorsToSystemWithNoOuterSeparators(String path)
path - The path to format.
FilenameUtils.separatorsToSystem(String),
StringUtils.strip(String, String)public static String separatorsToSystemWithNoEndSeparator(String path)
path - The path to format.
FilenameUtils.separatorsToSystem(String),
StringUtils.removeEnd(String, String)public static String getMD5Sum(String path)
path - The path to the file for which to calculate checksum for.
public static String getMD5Sum(File file)
file - The file to calculate the checksum for.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||