org.gcube.portlets.user.homelibrary.util.zip
Class UnzipUtil

java.lang.Object
  extended by org.gcube.portlets.user.homelibrary.util.zip.UnzipUtil

public class UnzipUtil
extends Object

Author:
Federico De Faveri defaveri@isti.cnr.it

Field Summary
protected static org.apache.log4j.Logger logger
           
 
Constructor Summary
UnzipUtil()
           
 
Method Summary
static void unzip(InputStream is, OutputStream os)
          Unzip the specified stream.
static void unzip(WorkspaceFolder destinationFolder, InputStream is, String zipName)
          Unzip the specified file into the specified workspace.
static InputStream unzipToTmp(InputStream is)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final org.apache.log4j.Logger logger
Constructor Detail

UnzipUtil

public UnzipUtil()
Method Detail

unzip

public static void unzip(WorkspaceFolder destinationFolder,
                         InputStream is,
                         String zipName)
                  throws IOException
Unzip the specified file into the specified workspace.

Parameters:
destinationFolder - the destination workspace.
is - the zip input stream.
zipName - the zip name.
Throws:
IOException - if an error occurs.

unzip

public static void unzip(InputStream is,
                         OutputStream os)
                  throws Exception
Unzip the specified stream.

Parameters:
is - the input stream.
os - the destination stream.
Throws:
Exception - if an error occurs.

unzipToTmp

public static InputStream unzipToTmp(InputStream is)
                              throws Exception
Parameters:
is - the zipped input stream.
Returns:
the resutil output stream.
Throws:
Exception - if an error occurs.


Copyright © 2013. All Rights Reserved.