org.kahina.core.util
Class FileUtilities
java.lang.Object
org.kahina.core.util.FileUtilities
public class FileUtilities
- extends Object
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FileUtilities
public FileUtilities()
copy
public static void copy(File source,
File destination)
throws IOException
- Throws:
IOException
deleteRecursively
public static boolean deleteRecursively(File file)
zipDirectory
public static void zipDirectory(File directory,
File zipFile,
ProgressMonitorWrapper monitor)
throws IOException
- Throws:
IOException
createTemporaryDirectory
public static File createTemporaryDirectory()
throws IOException
- Throws:
IOException
unzipToDirectory
public static void unzipToDirectory(ZipFile zipFile,
File directory,
String prefix,
ProgressMonitorWrapper monitor)
throws IOException
- Unzips zip entries whose names start with the given prefix to a given
directory. At the moment, this supports only flat structures without
further subdirectories.
- Parameters:
zipFile - directory - prefix - monitor -
- Throws:
IOException
read
public static String read(File file)
throws IOException
- Reads a whole file into a string.
- Parameters:
file -
- Returns:
- The contents of the file as a string.
- Throws:
IOException
write
public static void write(String text,
File file)
throws IOException
- Throws:
IOException
resourceAsTempFile
public static File resourceAsTempFile(Class<?> clazz,
String name)
throws IOException
- Throws:
IOException