public class ZipHandler extends Object
Constructor and Description |
---|
ZipHandler() |
Modifier and Type | Method and Description |
---|---|
void |
unzip(File zipfile,
File directory)
Unzips the contents of a zip file to a given directory.
|
void |
zip(File directoryToZip,
File toFile)
Creates a zip file containing the files (actual files as well as sub
directories) from a given directory, with relative file paths.
|
static void |
zipFile(File fileToZip,
File toFile)
Creates a zip file containing the given file, with relative file paths.
|
public void unzip(File zipfile, File directory) throws Exception
zipfile
- directory
- Exception
public void zip(File directoryToZip, File toFile) throws Exception
directoryToZip
- Directory that shall be zipped.toFile
- File to zip to.IOException
Exception
public static void zipFile(File fileToZip, File toFile) throws IOException
fileToZip
- File that shall be zipped.toFile
- File to zip to.IOException
Copyright © 2017. All rights reserved.