ewe.util.zip
Class ZipFile

java.lang.Object
  extended byewe.util.zip.ZipFile

public class ZipFile
extends Object

This class represents a Zip archive. You can ask for the contained entries, or get an input stream for a file entry. The entry is automatically decompressed. This class is thread safe: You can open input streams for arbitrary entries in different threads.


Field Summary
protected  String name
           
static int OPEN_DELETE
           
static int OPEN_READ
           
protected  ZipFile zip
           
 
Constructor Summary
protected ZipFile()
           
  ZipFile(File file)
           
  ZipFile(File file, int mode)
          Open a Zip file in a particular mode.
  ZipFile(String name)
           
 
Method Summary
 void close()
           
 Enumeration entries()
           
 ZipEntry getEntry(String name)
           
 InputStream getInputStream(ZipEntry ze)
           
 String getName()
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, toString
 

Field Detail

OPEN_READ

public static final int OPEN_READ
See Also:
Constant Field Values

OPEN_DELETE

public static final int OPEN_DELETE
See Also:
Constant Field Values

zip

protected ZipFile zip

name

protected String name
Constructor Detail

ZipFile

protected ZipFile()

ZipFile

public ZipFile(String name)
        throws IOException,
               ZipException

ZipFile

public ZipFile(File file)
        throws IOException,
               ZipException

ZipFile

public ZipFile(File file,
               int mode)
        throws IOException,
               ZipException
Open a Zip file in a particular mode.

Parameters:
file - The Zip formatted file.
mode - Ignored! Only OPEN_READ is supported.
Method Detail

close

public void close()
           throws IOException
Throws:
IOException

size

public int size()

entries

public Enumeration entries()

getEntry

public ZipEntry getEntry(String name)

getInputStream

public InputStream getInputStream(ZipEntry ze)
                           throws IOException,
                                  ZipException,
                                  IllegalStateException
Throws:
IOException
ZipException
IllegalStateException

getName

public String getName()