it.eng.spagobi.engines.talend.utils
Class ZipUtils

java.lang.Object
  extended by it.eng.spagobi.engines.talend.utils.ZipUtils

public class ZipUtils
extends java.lang.Object

Author:
Andrea Gioia

Constructor Summary
ZipUtils()
           
 
Method Summary
static void copyInputStream(java.io.InputStream in, java.io.OutputStream out)
          Copy input stream.
static java.lang.String[] getDirectoryNameByLevel(java.util.zip.ZipFile zipFile, int levelNo)
          Gets the directory name by level.
static void unzip(java.util.zip.ZipFile zipFile, java.io.File destDir)
          Unzip.
static void unzipSkipFirstLevel(java.util.zip.ZipFile zipFile, java.io.File destDir)
          Unzip skip first level.
 
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

copyInputStream

public static final void copyInputStream(java.io.InputStream in,
                                         java.io.OutputStream out)
                                  throws java.io.IOException
Copy input stream.

Parameters:
in - the in
out - the out
Throws:
java.io.IOException - Signals that an I/O exception has occurred.

unzip

public static void unzip(java.util.zip.ZipFile zipFile,
                         java.io.File destDir)
Unzip.

Parameters:
zipFile - the zip file
destDir - the dest dir

unzipSkipFirstLevel

public static void unzipSkipFirstLevel(java.util.zip.ZipFile zipFile,
                                       java.io.File destDir)
Unzip skip first level.

Parameters:
zipFile - the zip file
destDir - the dest dir

getDirectoryNameByLevel

public static java.lang.String[] getDirectoryNameByLevel(java.util.zip.ZipFile zipFile,
                                                         int levelNo)
Gets the directory name by level.

Parameters:
zipFile - the zip file
levelNo - the level no
Returns:
the directory name by level