deegree 2.3 (2010/04/09 10:10 build-4-official)

org.deegree.framework.util
Class ZipUtils

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

public class ZipUtils
extends 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(File file, String outdir)
           
 void doUnzip(InputStream is, String outdir)
           
 String doZip(String dirName, String archiveName, 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);
 String doZip(String dirName, String archiveName, 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
 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 String doZip(String dirName,
                               String archiveName,
                               String[] fileNames,
                               boolean deleteFiles)
             throws FileNotFoundException,
                    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:
FileNotFoundException
IOException

doZip

public String doZip(String dirName,
                    String archiveName,
                    String[] fileNames,
                    boolean deleteFiles,
                    boolean storeFolderPathInZip)
             throws FileNotFoundException,
                    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:
FileNotFoundException
IOException

getZipDetails

public String getZipDetails()
Returns:
details about the zipping

doUnzip

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

doUnzip

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

deegree 2.3 (2010/04/09 10:10 build-4-official)

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