it.eng.spagobi.commons.utilities
Class FileUtilities
java.lang.Object
it.eng.spagobi.commons.utilities.FileUtilities
public class FileUtilities
- extends java.lang.Object
- Author:
- Zerbetto (davide.zerbetto@eng.it)
Method Summary |
static void |
copyDirectory(java.io.File sourceDir,
java.io.File destDir,
boolean recursive,
boolean overwrite,
boolean renamePrevious)
Copy all files and contained directories (if recursive is true) in the source directory into the destination directory. |
static void |
copyDirectory(java.lang.String sourceDirStr,
java.lang.String destDirStr,
boolean recursive,
boolean overwrite,
boolean renamePrevious)
Copy all files and contained directories (if recursive is true) in the source directory into the destination directory. |
static boolean |
copyFile(java.io.File toBeCopied,
java.io.File toDir,
boolean overwrite,
boolean renamePrevious)
|
static boolean |
deleteDir(java.io.File dir)
Delete a folder and its contents. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FileUtilities
public FileUtilities()
copyFile
public static boolean copyFile(java.io.File toBeCopied,
java.io.File toDir,
boolean overwrite,
boolean renamePrevious)
copyDirectory
public static void copyDirectory(java.lang.String sourceDirStr,
java.lang.String destDirStr,
boolean recursive,
boolean overwrite,
boolean renamePrevious)
throws java.lang.Exception
- Copy all files and contained directories (if recursive is true) in the source directory into the destination directory.
- Parameters:
sourceDir
- The String representing the source directorydestDir
- The String representing the destination directoryrecursive
- Boolean: if it is true, contained directories are copied also recursivelyoverwrite
- Boolean: if it is true, contained files are overwritten
- Throws:
java.lang.Exception
copyDirectory
public static void copyDirectory(java.io.File sourceDir,
java.io.File destDir,
boolean recursive,
boolean overwrite,
boolean renamePrevious)
throws java.lang.Exception
- Copy all files and contained directories (if recursive is true) in the source directory into the destination directory.
- Parameters:
destDir
- The destination directory FilesourceDir
- The source directory Filerecursive
- Boolean: if it is true, contained directories are copied also recursivelyoverwrite
- Boolean: if it is true, contained files are overwritten
- Throws:
java.lang.Exception
deleteDir
public static boolean deleteDir(java.io.File dir)
- Delete a folder and its contents.
- Parameters:
dir
- The java file object of the directory
- Returns:
- the result of the operation