lapisx.io
Class ZipArchive

java.lang.Object
  extended bylapisx.io.ZipArchive
All Implemented Interfaces:
Serializable

public class ZipArchive
extends Object
implements Serializable

See Also:
Serialized Form

Constructor Summary
ZipArchive(InputStream in)
           
ZipArchive(InputStream in, int length)
           
ZipArchive(String[] filenames)
           
 
Method Summary
 void extract(String directory)
          Extract ZIP archive entries to the filesystem.
 void extract(String directory, PrintStream nameStream)
           
 void extract(String directory, String[] names)
           
 void extract(String directory, String[] names, PrintStream nameStream)
           
 String[] extractToTempDir()
           
 String[] extractToTempDir(String[] names)
           
 String filenameAt(int i)
           
 int getFilenameCount()
           
 InputStream getInputStream()
           
 String[] getNames()
           
 int length()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZipArchive

public ZipArchive(String[] filenames)
           throws IOException

ZipArchive

public ZipArchive(InputStream in)
           throws IOException

ZipArchive

public ZipArchive(InputStream in,
                  int length)
           throws IOException
Method Detail

getNames

public String[] getNames()

filenameAt

public String filenameAt(int i)

getFilenameCount

public int getFilenameCount()

length

public int length()

getInputStream

public InputStream getInputStream()

extract

public void extract(String directory)
             throws IOException
Extract ZIP archive entries to the filesystem. Each destination filename is computed by prefixing the ZIP entry name with directory.

Parameters:
directory - Directory where files should be placed. Null or empty string means current directory. If directory is non-empty and doesn't end with a file separator like / or \, then a file separator is added automatically.
Throws:
IOException

extract

public void extract(String directory,
                    PrintStream nameStream)
             throws IOException
Throws:
IOException

extract

public void extract(String directory,
                    String[] names)
             throws IOException
Throws:
IOException

extract

public void extract(String directory,
                    String[] names,
                    PrintStream nameStream)
             throws IOException
Throws:
IOException

extractToTempDir

public String[] extractToTempDir()
                          throws IOException
Throws:
IOException

extractToTempDir

public String[] extractToTempDir(String[] names)
                          throws IOException
Throws:
IOException