Package org.apache.jena.atlas.lib
Class FileOps
java.lang.Object
org.apache.jena.atlas.lib.FileOps
A library of utility operations on files and the filing system
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringReturn the basename (no path, no extension)static voidDelete all files and directories (recursively) in a directorystatic voidDelete all files and directories (recursively) in a directorystatic voidclearDirectory(String dir) Delete all files in a directorystatic voidCopy a filestatic voidstatic voidDelete a filestatic voiddeleteSilent(String filename) static voidEnsure a directory existsstatic booleanTest for existencestatic booleanexistsAnyFiles(String dir) See if there are any files in this directorystatic StringReturn the extension (or "")static StringfullDirectoryPath(String filename) static Stringstatic booleanTest for an empty filesplitDirBaseExt(String filename) Split a file name into path, basename and extension.splitDirFile(String filename) Split a file name into path and filename.
-
Method Details
-
delete
Delete a file- Parameters:
filename-
-
deleteSilent
-
delete
-
clearDirectory
Delete all files in a directory -
clearAll
Delete all files and directories (recursively) in a directory -
clearAll
Delete all files and directories (recursively) in a directory -
existsAnyFiles
See if there are any files in this directory -
exists
Test for existence -
isEmpty
Test for an empty file -
ensureDir
Ensure a directory exists -
splitDirBaseExt
Split a file name into path, basename and extension. Nulls returned if don't make sense. -
splitDirFile
Split a file name into path and filename. Nulls returned if don't make sense. -
basename
Return the basename (no path, no extension) -
extension
Return the extension (or "") -
fullPath
-
fullDirectoryPath
-
copyFile
Copy a file
-