Package gov.nasa.arc.pds.tools.util
Class FileUtils
java.lang.Object
gov.nasa.arc.pds.tools.util.FileUtils
A helper class for File related functionality.
- Version:
- $Revision: $
- Author:
- jagander
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic booleancontainsFile(File sourceFile, String searchName) static voiddeleteChildren(File file) static booleanstatic booleanstatic 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) getFileMap(File sourceFile) getFileMap(File sourceFile, String searchPattern) getFileMap(File sourceFile, String regex, boolean recursive) getFileMap(Map<Integer, File> sourceList, String regex) getFileMapByPattern(File sourceFile, Pattern searchPattern, boolean recursive, boolean excludeSourceControlFiles) getFilesByPattern(File sourceFile, Pattern searchPattern, boolean recursive) static Stringstatic 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 booleanstatic booleanisParent(FileMirror parent, FileMirror searchFile) static booleanstatic 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
-