Package org.wso2.carbon.utils
Class FileUtils
java.lang.Object
org.wso2.carbon.utils.FileUtils
File Utilities.
- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidCopies source file to destination file.static voidcopyFileToDir(File source, File destination) Copies src file to dst directory.static booleanDeletes all files and subdirectories under dir.
-
Method Details
-
deleteDir
Deletes all files and subdirectories under dir. Returns true if all deletions were successful. If a deletion fails, the method stops attempting to delete and returns false.- Parameters:
dir- The directory to be deleted- Returns:
- true if the directory and its descendents were deleted
-
copyFile
Copies source file to destination file. If the dst file does not exist, it is created- Parameters:
source- The source filedestination- The destination file- Throws:
IOException- If an Exception occurs while copying
-
copyFileToDir
Copies src file to dst directory. If the dst directory does not exist, it is created- Parameters:
source- The file to be copieddestination- The destination directory to which the file has to be copied- Throws:
IOException- If an error occurs while copying
-