public class FileUtils
extends java.lang.Object
FileUtils
Constructor and Description |
---|
FileUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
copyDirectory(java.io.File sourceLocation,
java.io.File targetLocation)
Copy one directory to another location (recursively)
|
static void |
copyFileStreams(java.io.File fromFile,
java.io.File toFile)
Copy a file from one location to another, and set the modification time to match.
|
static boolean |
deleteDir(java.io.File dir)
Delete a directory recursivley.
|
static void |
fileCopy(java.io.File src,
java.io.File dest,
boolean overwrite)
Copies file src to dest using nio.
|
static void |
fileRename(java.io.File file,
java.lang.String newPath)
Rename a file
|
static void |
fileRename(java.io.File file,
java.lang.String newPath,
java.lang.Class clazz)
Rename a file.
|
public static void fileCopy(java.io.File src, java.io.File dest, boolean overwrite) throws java.io.IOException
src
- source filedest
- destination fileoverwrite
- true to overwrite if it already existsjava.io.IOException
- on io errorpublic static void copyFileStreams(java.io.File fromFile, java.io.File toFile) throws java.io.IOException
fromFile
- source filetoFile
- dest filejava.io.IOException
- on io errorpublic static boolean deleteDir(java.io.File dir)
dir
- Directory to deletepublic static void fileRename(java.io.File file, java.lang.String newPath, java.lang.Class clazz)
file
- File to renamenewPath
- Path for new file nameclazz
- Class associated with lockCoreException
- An CoreException is raised if any underly I/O
operation fails.public static void fileRename(java.io.File file, java.lang.String newPath)
file
- File to renamenewPath
- Path for new file nameCoreException
- An CoreException is raised if any underly I/O
operation fails.public static void copyDirectory(java.io.File sourceLocation, java.io.File targetLocation) throws java.io.IOException
sourceLocation
- Source directorytargetLocation
- Target directoryjava.io.IOException
- Exception raised if any underlying I/O operation fails