public class ZipFiles
extends java.lang.Object
Constructor and Description |
---|
ZipFiles() |
Modifier and Type | Method and Description |
---|---|
static java.io.File |
gunzip(java.io.File gzFile)
gunzip a file.
|
static java.io.File |
gzip(java.io.File file)
gzip a file.
|
static java.io.File |
unzip(java.io.File zip)
Unzip a file.
|
static java.io.File |
unzip(java.io.File zip,
java.io.File dir)
Unzip a file.
|
static java.io.File |
unzip(java.io.File zip,
java.lang.String dir) |
static java.io.File |
zip(java.io.File dir)
Zip a directory.
|
static java.io.File |
zip(java.io.File zipFile,
java.util.Collection<java.io.File> files)
Zip a collection of files.
|
static java.io.File |
zip(java.io.File dir,
java.io.File zipFile)
Zips a dir into a file.
|
static java.io.File |
zip(java.io.File zipFile,
java.lang.Object... files)
Zip an array of files.
|
public static java.io.File gzip(java.io.File file) throws java.io.IOException
file
- The file to gzipjava.io.IOException
- if it failspublic static java.io.File gunzip(java.io.File gzFile) throws java.io.IOException
gzFile
- the file to gunzip, assumes a filename that has the .gz
extension added.java.io.IOException
- if unzipping failspublic static java.io.File zip(java.io.File dir) throws java.io.IOException
dir
- the directory to zipjava.io.IOException
- if the operation failspublic static java.io.File zip(java.io.File dir, java.io.File zipFile) throws java.io.IOException
dir
- the dir to zipzipFile
- the target zipfilejava.io.IOException
- if something goes wrongpublic static java.io.File zip(java.io.File zipFile, java.util.Collection<java.io.File> files) throws java.io.IOException
zipFile
- the target zip filefiles
- the files to addjava.io.IOException
- if something goes wrongpublic static java.io.File zip(java.io.File zipFile, java.lang.Object... files) throws java.io.IOException
zipFile
- the target zip filefiles
- the files to put into the zip file, can be String, File or
File[]java.io.IOException
- if something goes wrongpublic static java.io.File unzip(java.io.File zip) throws java.io.IOException
zip
- the file to unzip.java.io.IOException
- if operation failspublic static java.io.File unzip(java.io.File zip, java.io.File dir) throws java.io.IOException
zip
- the file to unzipdir
- the directory.java.io.IOException
- if unzipping failspublic static java.io.File unzip(java.io.File zip, java.lang.String dir) throws java.io.IOException
java.io.IOException
(c) 2012-2022, OMSLab, Colorado State University.