|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdk.netarkivet.common.utils.ZipUtils
public class ZipUtils
Utilities for interfacing with the (fairly low-level) java.util.zip package
Constructor Summary | |
---|---|
ZipUtils()
|
Method Summary | |
---|---|
static void |
gunzipFiles(java.io.File fromDir,
java.io.File toDir)
Gunzip all .gz files in a given directory into another. |
static void |
gzipFiles(java.io.File fromDir,
java.io.File toDir)
GZip each of the files in fromDir, placing the result in toDir (which will be created) with names having .gz appended. |
static void |
unzip(java.io.File zipFile,
java.io.File toDir)
Unzip a zipFile into a directory. |
static void |
zipDirectory(java.io.File dir,
java.io.File into)
Zip the contents of a directory into a file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ZipUtils()
Method Detail |
---|
public static void zipDirectory(java.io.File dir, java.io.File into)
dir
- The directory to zip.into
- The (zip) file to create. The name should typically end
in .zip, but that is not required.public static void unzip(java.io.File zipFile, java.io.File toDir)
zipFile
- The file to unziptoDir
- The directory to create the files under. This directory
will be created if necessary. Files in it will be overwritten if the
filenames match.public static void gzipFiles(java.io.File fromDir, java.io.File toDir)
fromDir
- An existing directorytoDir
- A directory where gzipped files will be placed. This
directory must not previously exist.
If the operation is not successfull, the directory will not be created.public static void gunzipFiles(java.io.File fromDir, java.io.File toDir)
fromDir
- The directory containing .gz filestoDir
- The directory to place the unzipped files in. This
directory must not exist beforehand.
IOFailure
- if there are problems creating the output directory
or gunzipping the files.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |