com.cloudbees.utils
Class ZipHelper

java.lang.Object
  extended by com.cloudbees.utils.ZipHelper

public class ZipHelper
extends java.lang.Object


Constructor Summary
ZipHelper()
           
 
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
 

Constructor Detail

ZipHelper

public ZipHelper()
Method Detail

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 directory
base - 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.