public class FileUtils extends Object
Constructor and Description |
---|
FileUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
copy(File source,
File target,
boolean overwrite)
Copy the file named by source to the target file.
|
static void |
createFileWithContent(File file,
String content)
Creates the given file and write the content to it.
|
static boolean |
isFileOfType(File file,
Pattern pattern)
Tests whether the given file is of the given type.
|
static boolean |
isHiddenFile(File file) |
static void |
recursiveCopy(File source,
File target,
IFileInterpreterProvider notthis) |
public static void createFileWithContent(File file, String content) throws IOException
file
- the file to createcontent
- the content to writeIOException
- - if the file exists or cannot be created.public static boolean isFileOfType(File file, Pattern pattern) throws IOException
file
- the file to testpattern
- the pattern to search in the first 1024 bytes of the fileIOException
public static void copy(File source, File target, boolean overwrite) throws IOException, FileNotFoundException
source
- the source filetarget
- the target fileoverwrite
- set to true to overwrite eexisting filesIOException
- - if the file already exists or another IO error occurredFileNotFoundException
- - if the source file cannot be foundpublic static void recursiveCopy(File source, File target, IFileInterpreterProvider notthis) throws IOException
IOException
public static boolean isHiddenFile(File file)