deegree 2.5 (2011/06/29 09:44 build-8-official)

org.deegree.framework.util
Class ZipUtils

java.lang.Object
  extended by org.deegree.framework.util.ZipUtils

public class ZipUtils
extends java.lang.Object

Version:
$Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18 Jun 2009) $
Author:
Andreas Poth, last edited by: $Author: mschneider $

Constructor Summary
ZipUtils()
           
 
Method Summary
 void doUnzip(java.io.File file, java.lang.String outdir)
           
 void doUnzip(java.io.InputStream is, java.lang.String outdir)
           
 java.lang.String doZip(java.lang.String dirName, java.lang.String archiveName, java.lang.String[] fileNames, boolean deleteFiles)
          Deprecated. please don't use this method any more. For the same result you might use doZip(dirName,archiveName,fileNames,deleteFiles,true);
 java.lang.String doZip(java.lang.String dirName, java.lang.String archiveName, java.lang.String[] fileNames, boolean deleteFiles, boolean storeFolderPathInZip)
          packs the passed files into a zip-archive, deletes the files if desired and returns the name of the archive as absolute path
 java.lang.String getZipDetails()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZipUtils

public ZipUtils()
Method Detail

doZip

@Deprecated
public java.lang.String doZip(java.lang.String dirName,
                                         java.lang.String archiveName,
                                         java.lang.String[] fileNames,
                                         boolean deleteFiles)
                       throws java.io.FileNotFoundException,
                              java.io.IOException
Deprecated. please don't use this method any more. For the same result you might use doZip(dirName,archiveName,fileNames,deleteFiles,true);

packs the passed files into a zip-archive, deletes the files if desired and returns the name of the archive

Parameters:
dirName - name of the directory where to store the archive
archiveName - desired archive name
fileNames - names of the files to be packed into the zip archive
deleteFiles - if true all files will be deleted after zip-file has been created
Returns:
the name of the archive
Throws:
java.io.FileNotFoundException
java.io.IOException

doZip

public java.lang.String doZip(java.lang.String dirName,
                              java.lang.String archiveName,
                              java.lang.String[] fileNames,
                              boolean deleteFiles,
                              boolean storeFolderPathInZip)
                       throws java.io.FileNotFoundException,
                              java.io.IOException
packs the passed files into a zip-archive, deletes the files if desired and returns the name of the archive as absolute path

Parameters:
dirName - name of the directory where the files are found (see fileNames) and where the archive will be stored. Needs to be an absolute path.
archiveName - desired name of the archive. It will be stored in the directory given in dirName.
fileNames - names of the files to be packed into the zip archive. The files are expected to be in the directory given in dirName.
deleteFiles - if true all files will be deleted after zip-file has been created
storeFolderPathInZip - if true, the files are stored in the zip according to their folder structur (with absolute paths); if false, the files are stored under their file name only.
Returns:
the name of the zip file (combined dirName and archiveName)
Throws:
java.io.FileNotFoundException
java.io.IOException

getZipDetails

public java.lang.String getZipDetails()
Returns:
details about the zipping

doUnzip

public void doUnzip(java.io.File file,
                    java.lang.String outdir)
             throws java.io.IOException
Parameters:
file -
outdir -
Throws:
java.io.IOException

doUnzip

public void doUnzip(java.io.InputStream is,
                    java.lang.String outdir)
             throws java.io.IOException
Parameters:
is -
outdir -
Throws:
java.io.IOException

deegree 2.5 (2011/06/29 09:44 build-8-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org