it.geosolutions.tools.compress.file
Class Extractor

java.lang.Object
  extended by it.geosolutions.tools.compress.file.Extractor

public final class Extractor
extends Object

A Class container for Extractors methods.

Author:
Carlo Cancellieri - carlo.cancellieri@geo-solutions.it

Constructor Summary
Extractor()
           
 
Method Summary
static void extractBz2(File in_file, File out_file)
           
static void extractGzip(File in_file, File out_file)
           
static void unZip(String inputZipName, String outputFileName)
           
static List<File> unzipFlat(File zipFile, File destDir)
          Deprecated. use Extractor.unZip instead which support complex zip structure
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Extractor

public Extractor()
Method Detail

unzipFlat

public static List<File> unzipFlat(File zipFile,
                                   File destDir)
Deprecated. use Extractor.unZip instead which support complex zip structure

Unzips the files from a zipfile into a directory. All of the files will be put in a single direcotry. If the zipfile contains a hierarchycal structure, it will be ignored.

Parameters:
zipFile - The zipfile to be examined
destDir - The direcotry where the extracted files will be stored.
Returns:
The list of the extracted files, or null if an error occurred.
Throws:
IllegalArgumentException - if the destination dir is not writeable.

unZip

public static void unZip(String inputZipName,
                         String outputFileName)
                  throws IOException,
                         org.apache.commons.compress.compressors.CompressorException
Parameters:
inputZipName - - the input zip file
outputFileName - - a directory with this name containing zip files will be created
Throws:
IOException
org.apache.commons.compress.compressors.CompressorException

extractBz2

public static void extractBz2(File in_file,
                              File out_file)
                       throws org.apache.commons.compress.compressors.CompressorException
Throws:
org.apache.commons.compress.compressors.CompressorException

extractGzip

public static void extractGzip(File in_file,
                               File out_file)
                        throws org.apache.commons.compress.compressors.CompressorException
Parameters:
in_file - the input bz2 file to extract
out_file - the output tar file to extract to
Throws:
org.apache.commons.compress.compressors.CompressorException


Copyright © 2011-2012 GeoSolutions. All Rights Reserved.