Modifier and Type | Field and Description |
---|---|
static String |
GZIP_SUFFIX
The standard suffix for a gzipped file.
|
Modifier and Type | Method and Description |
---|---|
static void |
gunzipFile(File fromFile,
File toFile)
Gunzip a single gzipped file into the given file.
|
static void |
gunzipFiles(File fromDir,
File toDir)
Gunzip all .gz files in a given directory into another.
|
static void |
gzipFiles(File fromDir,
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(File zipFile,
File toDir)
Unzip a zipFile into a directory.
|
static void |
zipDirectory(File dir,
File into)
Zip the contents of a directory into a file.
|
public static final String GZIP_SUFFIX
public static void zipDirectory(File dir, 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(File zipFile, 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(File fromDir, 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 successful, the directory will not be created.public static void gunzipFiles(File fromDir, 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.public static void gunzipFile(File fromFile, File toFile)
fromFile
- A gzipped file to unzip.toFile
- The file that the contents of fromFile should be gunzipped into. This file must be in an existing
directory. Existing contents of this file will be overwritten.Copyright © 2005–2015 The Royal Danish Library, the Danish State and University Library, the National Library of France and the Austrian National Library.. All rights reserved.