ZipFile

public class ZipFile extends Object
implements Closeable
Known Direct Subclasses

This class is used to read entries from a zip file.

Unless otherwise noted, passing a null argument to a constructor or method in this class will cause a NullPointerException to be thrown.

Constant Summary

int CENATT
int CENATX
int CENCOM
int CENCRC
int CENDSK
int CENEXT
int CENFLG
int CENHDR
int CENHOW
int CENLEN
int CENNAM
int CENOFF
long CENSIG
int CENSIZ
int CENTIM
int CENVEM
int CENVER
int ENDCOM
int ENDHDR
int ENDOFF
long ENDSIG
int ENDSIZ
int ENDSUB
int ENDTOT
int EXTCRC
int EXTHDR
int EXTLEN
long EXTSIG
int EXTSIZ
int LOCCRC
int LOCEXT
int LOCFLG
int LOCHDR
int LOCHOW
int LOCLEN
int LOCNAM
long LOCSIG
int LOCSIZ
int LOCTIM
int LOCVER
int OPEN_DELETE Mode flag to open a zip file and mark it for deletion.
int OPEN_READ Mode flag to open a zip file for reading.

Public Constructor Summary

ZipFile(String name)
Opens a zip file for reading.
ZipFile(File file, int mode)
Opens a new ZipFile to read from the specified File object in the specified mode.
ZipFile(File file)
Opens a ZIP file for reading given the specified File object.
ZipFile(File file, int mode, Charset charset)
Opens a new ZipFile to read from the specified File object in the specified mode.
ZipFile(String name, Charset charset)
Opens a zip file for reading.
ZipFile(File file, Charset charset)
Opens a ZIP file for reading given the specified File object.

Public Method Summary

void
close()
Closes the ZIP file.
Enumeration<? extends ZipEntry>
entries()
Returns an enumeration of the ZIP file entries.
String
getComment()
Returns the zip file comment, or null if none.
ZipEntry
getEntry(String name)
Returns the zip file entry for the specified name, or null if not found.
InputStream
getInputStream(ZipEntry entry)
Returns an input stream for reading the contents of the specified zip file entry.
String
getName()
Returns the path name of the ZIP file.
int
size()
Returns the number of entries in the ZIP file.

Protected Method Summary

void
finalize()
Ensures that the system resources held by this ZipFile object are released when there are no more references to it.

Inherited Method Summary