public final class ZipHelper extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
ZipHelper.ZipEntryHandler |
| Modifier and Type | Method and Description |
|---|---|
static void |
addDirectoryToZip(File directory,
File base,
String dirPrefix,
ZipOutputStream zos)
Recursively inserts all files in a directory into a zipstream.
|
static File |
unzipEntryToFolder(ZipEntry entry,
InputStream zis,
File destFolder) |
static void |
unzipFile(InputStream fis,
ZipHelper.ZipEntryHandler zipHandler,
boolean closeStream) |
public static void addDirectoryToZip(File directory, File base, String dirPrefix, ZipOutputStream zos) throws IOException
directory - the source directorybase - optional parent directory that should serve as the entry root.
Only path info after this base will be included as part of the
entry name. By default, the directory parameter serves as
root.dirPrefix - optional directory prefix to prepend onto each entry name.zos - the zip stream to add the files to.IOExceptionpublic static void unzipFile(InputStream fis, ZipHelper.ZipEntryHandler zipHandler, boolean closeStream) throws IOException
IOExceptionpublic static File unzipEntryToFolder(ZipEntry entry, InputStream zis, File destFolder) throws IOException
IOExceptionCopyright © 2011-2015. All Rights Reserved.