public final class FileUtils extends Object
Constructor and Description |
---|
FileUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
copyDirectory(File source,
File target)
Copy the source directory to the target directory.
|
static void |
copyDirectory(Path source,
Path target)
Copy the source directory to the target directory.
|
static void |
deleteDirectory(File directory)
Delete the given directory recursively.
|
static void |
deleteDirectory(Path directory)
Delete the given directory recursively.
|
static File |
getFile(File directory,
String next,
String... more)
Get a file from the given path elements.
|
static File |
getFile(String first,
String... more)
Get a file from the given path elements.
|
public static File getFile(String first, String... more)
first
- the first path elementmore
- the additional path elementspublic static File getFile(File directory, String next, String... more)
directory
- the parent directorynext
- next path elementmore
- additional path elementspublic static void copyDirectory(File source, File target) throws IOException
source
- the source directorytarget
- the target directoryIOException
- if IO error occurs during copyingpublic static void copyDirectory(Path source, Path target) throws IOException
source
- the source directorytarget
- the target directoryIOException
- if IO error occurs during copyingpublic static void deleteDirectory(File directory) throws IOException
directory
- the directory to deleteIOException
- in case deletion is unsuccessfulpublic static void deleteDirectory(Path directory) throws IOException
directory
- the directory to deleteIOException
- in case deletion is unsuccessful