org.deegree.framework.util
Class ZipUtils
java.lang.Object
  
org.deegree.framework.util.ZipUtils
public class ZipUtils
- extends Object
 
- Version:
 
  - $Revision: 7864 $, $Date: 2007-07-30 21:08:40 +0200 (Mo, 30 Jul 2007) $
 
- Author:
 
  - Andreas Poth, last edited by: $Author: apoth $
 
 
| 
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 | 
 
ZipUtils
public ZipUtils()
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 archivearchiveName - desired archive namefileNames - names of the files to be packed into the zip archivedeleteFiles - 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 createdstoreFolderPathInZip - 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
 
				an open source project founded by lat/lon, Bonn, Germany.
					For more information visit: http://deegree.sourceforge.net