All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.util.zip.ZipFile

java.lang.Object
   |
   +----java.util.zip.ZipFile

public class ZipFile
extends Object
implements ZipConstants
This class can be used to read the contents of a ZIP file. It uses RandomAccessFile for quick access to ZIP file entries, and supports both compressed and uncompressed entries.


Constructor Index

 o ZipFile(File)
Opens a ZIP file for reading given the specified File object.
 o ZipFile(String)
Opens a ZIP file for reading given the specified file name.

Method Index

 o close()
Closes the ZIP file.
 o entries()
Returns an enumeration of the ZIP file entries.
 o getEntry(String)
Returns the ZIP file entry for the given path name.
 o getInputStream(ZipEntry)
Returns an input stream for reading the contents of the specified ZIP file entry.
 o getName()
Returns the path name of the ZIP file.

Constructors

 o ZipFile
    method ZipFile(name=String) public Signals IOException
Opens a ZIP file for reading given the specified file name.

Parameters:
name - the name of the zip file
Throws: ZipException
if a ZIP format error has occurred
Throws: IOException
if an I/O error has occurred
 o ZipFile
    method ZipFile(file=File) public Signals ZipException, IOException
Opens a ZIP file for reading given the specified File object.

Parameters:
file - the ZIP file to be opened for reading
Throws: ZipException
if a ZIP error has occurred
Throws: IOException
if an I/O error has occurred

Methods

 o getEntry
    method getEntry(name=String) returns ZipEntry public     
Returns the ZIP file entry for the given path name. Returns null if there is no entry corresponding to the given name.

Parameters:
name - the name of the entry
Returns:
the ZIP file entry
 o getInputStream
    method getInputStream(ze=ZipEntry) returns InputStream public     Signals IOException
Returns an input stream for reading the contents of the specified ZIP file entry.

Parameters:
ze - the zip file entry
Throws: ZipException
if a ZIP format error has occurred
Throws: IOException
if an I/O error has occurred
 o getName
    method getName() returns String public     
Returns the path name of the ZIP file.

 o entries
    method entries() returns Enumeration public     
Returns an enumeration of the ZIP file entries.

 o close
    method close()  public     Signals IOException
Closes the ZIP file.


All Packages  Class Hierarchy  This Package  Previous  Next  Index