public final class FileUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
close(Closeable resource)
Closes a resource if it is not null.
|
static void |
copyResource(String resource,
File destination)
Copy a classpath resource to a destination file.
|
static boolean |
deleteRecursive(File path)
Delete all files rooted in the given path.
|
static void |
packDirectory(File dir,
ZipOutputStream zos)
Pack a directory into a single zip file.
|
public static void copyResource(String resource, File destination) throws IOException
resource - Path to resource to copy.destination - File to copy resource to.IOException - exception2public static void close(Closeable resource)
resource - resource to closepublic static void packDirectory(File dir, ZipOutputStream zos) throws IOException
Note: The implementation is based on the packZip method in jetbrains openAPI. original author is Maxim Podkolzine (maxim.podkolzine@jetbrains.com)
dir - inputzos - output streamIOException - exception1public static boolean deleteRecursive(File path) throws FileNotFoundException
path - root path to deleteTrue if all files were deleted successfully.FileNotFoundException - in case path couldn't be found.Copyright © 2011-2018 White Source. All Rights Reserved.