Package gov.nasa.arc.pds.tools.util
Class FileUtils
java.lang.Object
gov.nasa.arc.pds.tools.util.FileUtils
public class FileUtils extends Object
A helper class for File related functionality.
- Version:
- $Revision: $
- Author:
- jagander
-
Field Summary
Fields Modifier and Type Field Description static longONE_GBThe number of bytes in a gigabyte.static longONE_KBThe number of bytes in a kilobyte.static longONE_MBThe number of bytes in a megabyte.static longONE_PBstatic longONE_TBstatic StringOPPOSITE_SEP_CHARstatic StringREGEX_SAFE_SEP -
Constructor Summary
Constructors Constructor Description FileUtils() -
Method Summary
Modifier and Type Method Description static voidclose(Closeable closeMe, boolean reThrowExceptions)static booleancontainsFile(File sourceFile, String searchName)static voiddeleteChildren(File file)static booleanempty(File directory)static booleanexists(File file)static booleanforceDeleteAll(File file)static StringfromVaxPath(String vaxPath)static FilegetAlternateCaseFile(File rootFile, String searchName)static FilegetBaseFile(File file)static StringgetBaseName(File file)static FilegetCaseUnknownFile(File rootFile, String searchName)static StringgetContents(File file)static StringgetExtension(File file)static StringgetExtension(String name)static Map<Integer,File>getFileMap(File sourceFile)static Map<Integer,File>getFileMap(File sourceFile, String searchPattern)static Map<Integer,File>getFileMap(File sourceFile, String regex, boolean recursive)static Map<Integer,File>getFileMap(Map<Integer,File> sourceList, String regex)static Map<Integer,File>getFileMapByPattern(File sourceFile, Pattern searchPattern, boolean recursive, boolean excludeSourceControlFiles)static List<File>getFiles(File sourceFile)static List<File>getFiles(File sourceFile, String searchPattern)static List<File>getFiles(File sourceFile, String regex, boolean recursive)static List<File>getFiles(List<File> sourceList, String regex)static List<File>getFilesByPattern(File sourceFile, Pattern searchPattern, boolean recursive)static StringgetRegexSeparator()static StringgetRelativePath(File baseDirectory, File targetFile)static StringgetRelativePath(String basePath, String fullPath)static StringgetRelativePath(URL baseDirectory, URL targetFile)static StringgetSafeName(String string)static FilegetSibling(String fileName, File knownFile)static FilegetTopFileByPattern(File sourceFile, String regex, Integer maxDepth)static FilegetTopFileByPattern(File sourceFile, Pattern searchPattern, Integer maxDepth)static FilegetValidParent(File missingFile)static booleanhasParent(List<File> parents, File searchFile)static booleanisParent(FileMirror parent, FileMirror searchFile)static booleanisParent(File parent, File searchFile)static booleanisSourceControl(File file)static PropertiesloadProperties(File file)static PropertiesloadProperties(Properties props, File file)
-
Field Details
-
ONE_KB
public static final long ONE_KBThe number of bytes in a kilobyte. -
ONE_MB
public static final long ONE_MBThe number of bytes in a megabyte. -
ONE_GB
public static final long ONE_GBThe number of bytes in a gigabyte. -
ONE_TB
public static final long ONE_TB -
ONE_PB
public static final long ONE_PB -
OPPOSITE_SEP_CHAR
-
REGEX_SAFE_SEP
-
-
Constructor Details
-
FileUtils
public FileUtils()
-
-
Method Details
-
containsFile
-
getFiles
-
getFiles
-
getFiles
-
getFilesByPattern
-
getTopFileByPattern
-
getTopFileByPattern
-
getFiles
-
getFileMap
-
getFileMap
-
getFileMap
-
getFileMapByPattern
-
getFileMap
-
getContents
- Throws:
IOException
-
getBaseFile
-
getValidParent
-
getRelativePath
-
getRelativePath
-
getRelativePath
-
getExtension
-
getExtension
-
getBaseName
-
isParent
-
isParent
-
hasParent
-
fromVaxPath
-
getRegexSeparator
-
getSibling
-
exists
-
loadProperties
-
loadProperties
-
close
-
getCaseUnknownFile
-
getAlternateCaseFile
-
deleteChildren
-
forceDeleteAll
-
empty
-
isSourceControl
-
getSafeName
-