java.util.zip.ZipFile
java.lang.Object
None
None
New as of JDK 1.1
The ZipFile class represents a ZIP file. Unlike with a ZipInputStream, you can read the entries in a ZipFile nonsequentially. Internally, the class uses a RandomAccessFile so that you can read the entries from the file in any order. You can obtain a list of the entries in this ZIP file by calling entries(). Given an entry, you can get an InputStream for that entry using getInputStream().
public class java.util.zip.ZipFile extends java.lang.Object { // Constructors public ZipFile(File file); public ZipFile(String name); // Instance Methods public void close(); public Enumeration entries(); public ZipEntry getEntry(String name); public InputStream getInputStream(ZipEntry ze); public String getName(); }
The File to read.
If the ZIP file cannot be read.
If any other kind of I/O error occurs.
This constructor creates a ZipFile for reading from the given File object.
A string that contains the path name of the file.
If the ZIP file cannot be read.
If any other kind of I/O error occurs.
This constructor creates a ZipFile for reading from the file specified by the given path.
If any kind of I/O error occurs.
This method closes the ZipFile and releases its system resources.
An Enumeration of ZipEntry objects.
This method returns an enumeration of ZipEntry objects that represents the contents of this ZipFile.
The entry name.
The entry corresponding to the given name or null if there is no such entry.
This method returns the ZipEntry object that corresponds to the given entry name.
A ZipEntry in this file.
An InputStream for the given entry.
If a ZIP file format error occurs.
If any other kind of I/O error occurs.
This method returns an input stream that can read the entry described by the supplied ZipEntry.
The path of this file.
This method returns the path name of this ZipFile.
Method |
Inherited From |
Method |
Inherited From |
---|---|---|---|
clone() |
Object |
equals(Object) |
Object |
finalize() |
Object |
getClass() |
Object |
hashCode() |
Object |
notify() |
Object |
notifyAll() |
Object |
toString() |
Object |
wait() |
Object |
wait(long) |
Object |
wait(long, int) |
Object |
Enumeration, File, InputStream, IOException, RandomAccessFile, String, ZipEntry, ZipException, ZipInputStream
This HTML Help has been published using the chm2web software. |