org.ow2.petals.util
Class ZipUtil

java.lang.Object
  extended by org.ow2.petals.util.ZipUtil

public final class ZipUtil
extends java.lang.Object

Contains utilities methods in relation to Zip operations.

Author:
ddesjardins, ofabre - eBMWebsourcing

Method Summary
static java.io.File getEntryAsTemp(java.util.zip.ZipFile zipFile, java.lang.String entryName)
          Create a temporary File from a given entry of a given ZipFile.
static void unzipArchive(java.io.File zipFile, java.io.File destDir)
          Unzip given zip file into the given destination
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getEntryAsTemp

public static java.io.File getEntryAsTemp(java.util.zip.ZipFile zipFile,
                                          java.lang.String entryName)
                                   throws org.ow2.petals.kernel.api.server.PetalsException,
                                          java.io.IOException
Create a temporary File from a given entry of a given ZipFile. You must delete the temp file after using it.

Parameters:
zipFile - the Zipped file to search in, must be non null
entryName - the name of an entry in the Zip file, must be non null and non empty
Returns:
a temp File read from the Zip entry, not null.
Throws:
org.ow2.petals.kernel.api.server.PetalsException - if entry can't be found or if an error occured during zip reading
java.io.IOException

unzipArchive

public static void unzipArchive(java.io.File zipFile,
                                java.io.File destDir)
                         throws java.io.IOException
Unzip given zip file into the given destination

Parameters:
zipFile - the File to unzip, must not be null
destDir - the destination directory, can be null
Throws:
java.io.IOException - if an I/O error occurred


Copyright © 2005-2011 Petals Link (EBM Websourcing). All Rights Reserved.