org.bibalex.daf.handlers.compressionhandler
Class UnZipper

java.lang.Object
  extended by org.bibalex.daf.handlers.compressionhandler.UnZipper

public class UnZipper
extends java.lang.Object

This class unzips Zip files or Jars into a given folder.

Author:
fadi.edward

Field Summary
protected  byte[] b
          The buffer for reading/writing the ZipFile data
protected  java.util.SortedSet<java.lang.String> dirsMade
          Cache of paths we've mkdir()ed.
protected  boolean warnedMkDir
           
protected  java.util.zip.ZipInputStream zippy
          The ZipFile that is used to read an archive
 
Constructor Summary
UnZipper()
          Construct an UnZip object.
 
Method Summary
protected  void getFile(java.util.zip.ZipEntry e, java.lang.String unZipLocation)
          Process one file from the zip, given its name.
 void unZip(java.lang.String fileName, java.lang.String unzipLocation)
          For a given Zip file, process each entry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

zippy

protected java.util.zip.ZipInputStream zippy
The ZipFile that is used to read an archive


b

protected byte[] b
The buffer for reading/writing the ZipFile data


dirsMade

protected java.util.SortedSet<java.lang.String> dirsMade
Cache of paths we've mkdir()ed.


warnedMkDir

protected boolean warnedMkDir
Constructor Detail

UnZipper

public UnZipper()
Construct an UnZip object. Just allocate the buffer

Method Detail

unZip

public void unZip(java.lang.String fileName,
                  java.lang.String unzipLocation)
           throws UnZipperException
For a given Zip file, process each entry.

Parameters:
fileName - The filename to be unzipped.
unzipLocation - the location to beunzipped in.
Throws:
UnZipperException

getFile

protected void getFile(java.util.zip.ZipEntry e,
                       java.lang.String unZipLocation)
                throws java.io.IOException
Process one file from the zip, given its name. Either print the name, or create the file on disk.

Parameters:
e - The zip entry to be unzipped.
unZipLocation - the location to be unzipped to.
Throws:
java.io.IOException