com.cloudbees.utils
Class ZipHelper
java.lang.Object
com.cloudbees.utils.ZipHelper
public class ZipHelper
- extends Object
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ZipHelper
public ZipHelper()
addDirectoryToZip
public static final void addDirectoryToZip(File directory,
File base,
String dirPrefix,
ZipOutputStream zos)
throws IOException
- Recursively inserts all files in a directory into a zipstream.
- Parameters:
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.
- Throws:
IOException
unzipFile
public static void unzipFile(InputStream fis,
ZipHelper.ZipEntryHandler zipHandler,
boolean closeStream)
throws IOException
- Throws:
IOException
unzipEntryToFolder
public static File unzipEntryToFolder(ZipEntry entry,
InputStream zis,
File destFolder)
throws IOException
- Throws:
IOException
Copyright © 2011-2012. All Rights Reserved.