Package org.ow2.clif.util
Class FileUtil
- java.lang.Object
-
- org.ow2.clif.util.FileUtil
-
public abstract class FileUtil extends java.lang.ObjectFile utilities- Author:
- Bruno Dillenseger
-
-
Constructor Summary
Constructors Constructor Description FileUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcopyFromResource(java.lang.String resource, java.io.File target)Creates/overwrites a file copying content from a resource.static booleandelete(java.io.File root)Recursively deletes a directory or just a single file.
-
-
-
Method Detail
-
delete
public static boolean delete(java.io.File root)
Recursively deletes a directory or just a single file. Fails as soon as one file can't be deleted.- Parameters:
root- the file or directory to delete- Returns:
- true if the file or directory have been deleted, false if at least one file could not be deleted.
-
copyFromResource
public static void copyFromResource(java.lang.String resource, java.io.File target) throws java.io.IOExceptionCreates/overwrites a file copying content from a resource.- Parameters:
resource- the resource file path (to be resolved using this class' class loader)target- the file path to create (all directories in the path are created when necessary and possible)- Throws:
java.io.IOException- an exception occurred either while trying to get the resource or creating the target file
-
-