com.dynamide.util
Class ZipTools

java.lang.Object
  extended by com.dynamide.util.ZipTools

public class ZipTools
extends java.lang.Object

User: laramie $LastChangedRevision: $ $LastChangedDate: $


Nested Class Summary
static class ZipTools.UnzipResults
           
 
Constructor Summary
ZipTools()
           
 
Method Summary
static void addToZip(java.util.zip.ZipOutputStream zos, java.lang.String filename, java.lang.String nameInArchive)
           
static void copyInputStream(java.io.InputStream in, java.io.OutputStream out)
           
static void forceParentDirectories(java.lang.String filename)
           
static ZipTools.UnzipResults unzip(java.lang.String zipfileName, java.lang.String baseOutputDir)
          It is HIGHLY recommended to use a baseOutputDir, such as "./", or a local directory you know, such as "/tmp/foo", to prevent files from being unzipped in your root directory.
static ZipTools.UnzipResults unzip(java.lang.String zipfileName, java.lang.String baseOutputDir, boolean overwriteExistingFiles)
           
static void zipDir(int stripLeadingPathChars, java.lang.String dir2zip, java.util.zip.ZipOutputStream zos)
           
static void zipDiveDirectory(int stripLeadingPathChars, java.lang.String directory, java.lang.String zipFilename)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZipTools

public ZipTools()
Method Detail

copyInputStream

public static final void copyInputStream(java.io.InputStream in,
                                         java.io.OutputStream out)
                                  throws java.io.IOException
Throws:
java.io.IOException

forceParentDirectories

public static void forceParentDirectories(java.lang.String filename)
                                   throws java.lang.Exception
Throws:
java.lang.Exception

unzip

public static final ZipTools.UnzipResults unzip(java.lang.String zipfileName,
                                                java.lang.String baseOutputDir)
It is HIGHLY recommended to use a baseOutputDir, such as "./", or a local directory you know, such as "/tmp/foo", to prevent files from being unzipped in your root directory.


unzip

public static final ZipTools.UnzipResults unzip(java.lang.String zipfileName,
                                                java.lang.String baseOutputDir,
                                                boolean overwriteExistingFiles)

zipDiveDirectory

public static void zipDiveDirectory(int stripLeadingPathChars,
                                    java.lang.String directory,
                                    java.lang.String zipFilename)
                             throws java.lang.Exception
Throws:
java.lang.Exception

zipDir

public static void zipDir(int stripLeadingPathChars,
                          java.lang.String dir2zip,
                          java.util.zip.ZipOutputStream zos)
                   throws java.lang.Exception
Throws:
java.lang.Exception

addToZip

public static void addToZip(java.util.zip.ZipOutputStream zos,
                            java.lang.String filename,
                            java.lang.String nameInArchive)
                     throws java.lang.Exception
Throws:
java.lang.Exception


Copyright 2001-2013 DYNAMIDE.COM. All Rights Reserved.