public class FileUtil
extends java.lang.Object
Constructor and Description |
---|
FileUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
copy(java.io.File source,
java.io.File destination) |
static java.io.File |
createTemporaryDirectory() |
static boolean |
deleteRecursively(java.io.File file) |
static java.lang.String |
read(java.io.File file)
Reads a whole file into a string.
|
static java.io.File |
resourceAsTempFile(java.lang.Class<?> clazz,
java.lang.String name) |
static java.lang.String |
slurpFile(java.lang.String file) |
static void |
unzipToDirectory(java.util.zip.ZipFile zipFile,
java.io.File directory,
java.lang.String prefix,
ProgressMonitorWrapper monitor)
Unzips zip entries whose names start with the given prefix to a given
directory.
|
static void |
write(java.lang.String text,
java.io.File file) |
static void |
writeStringToFile(java.lang.String string,
java.lang.String file) |
static void |
zipDirectory(java.io.File directory,
java.io.File zipFile,
ProgressMonitorWrapper monitor) |
public static java.lang.String slurpFile(java.lang.String file) throws java.io.IOException
java.io.IOException
public static void writeStringToFile(java.lang.String string, java.lang.String file) throws java.io.IOException
java.io.IOException
public static void copy(java.io.File source, java.io.File destination) throws java.io.IOException
java.io.IOException
public static boolean deleteRecursively(java.io.File file)
public static void zipDirectory(java.io.File directory, java.io.File zipFile, ProgressMonitorWrapper monitor) throws java.io.IOException
java.io.IOException
public static java.io.File createTemporaryDirectory() throws java.io.IOException
java.io.IOException
public static void unzipToDirectory(java.util.zip.ZipFile zipFile, java.io.File directory, java.lang.String prefix, ProgressMonitorWrapper monitor) throws java.io.IOException
zipFile
- directory
- prefix
- monitor
- java.io.IOException
public static java.lang.String read(java.io.File file) throws java.io.IOException
file
- java.io.IOException
public static void write(java.lang.String text, java.io.File file) throws java.io.IOException
java.io.IOException
public static java.io.File resourceAsTempFile(java.lang.Class<?> clazz, java.lang.String name) throws java.io.IOException
java.io.IOException