public final class FileUtils extends Object
Modifier and Type | Method and Description |
---|---|
static void |
copyFile(File src,
File dest,
StreamMonitor monitor)
Copies a file.
|
static boolean |
delete(File file)
Deletes the file or recursively deletes a directory depending on the file
passed.
|
static File |
getFileFromClasspath(String filePath)
Searches the classpath for the file denoted by the file path and returns
the corresponding file.
|
static File[] |
pathNamesToFiles(String... names)
|
public static void copyFile(File src, File dest, StreamMonitor monitor) throws IOException, FileNotFoundException
src
- The source file.dest
- The destination file.monitor
- The monitor to use for reporting.IOException
- if any underlying I/O problem occurs.FileNotFoundException
- if the source file does not exist.public static File getFileFromClasspath(String filePath) throws FileNotFoundException
filePath
- path to the fileFileNotFoundException
- if the file cannot be foundpublic static boolean delete(File file)
file
- file or directory to be deleted.Copyright © 2006–2019 OPS4J - Open Participation Software for Java. All rights reserved.