com.cloudbees.utils
Class ZipHelper
java.lang.Object
com.cloudbees.utils.ZipHelper
public class ZipHelper
- extends java.lang.Object
|
Method Summary |
static void |
addDirectoryToZip(java.io.File directory,
java.io.File base,
java.lang.String dirPrefix,
java.util.zip.ZipOutputStream zos)
Recursively inserts all files in a directory into a zipstream. |
static java.io.File |
unzipEntryToFolder(java.util.zip.ZipEntry entry,
java.io.InputStream zis,
java.io.File destFolder)
|
| 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(java.io.File directory,
java.io.File base,
java.lang.String dirPrefix,
java.util.zip.ZipOutputStream zos)
throws java.io.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:
java.io.IOException
unzipEntryToFolder
public static java.io.File unzipEntryToFolder(java.util.zip.ZipEntry entry,
java.io.InputStream zis,
java.io.File destFolder)
throws java.io.IOException
- Throws:
java.io.IOException
Copyright © 2011. All Rights Reserved.