|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.zip.ZipFile
public class ZipFile
This class provides read-only random access to a Zip archive. The easy way to do this would be to use ZipInputStream to scan out the entries. This is less efficient than reading the central directory, because it requires performing small reads at points across the entire file, rather than reading one concentrated blob. Use ZipOutputStream if you want to create an archive.
| Nested Class Summary | |
|---|---|
(package private) static class |
ZipFile.RAFStream
|
| Field Summary | |
|---|---|
(package private) String |
fileName
|
(package private) File |
fileToDeleteOnClose
|
(package private) ZipEntry.LittleEndianReader |
ler
|
static int |
OPEN_DELETE
Delete zip file when closed. |
static int |
OPEN_READ
Open zip file for read. |
| Fields inherited from interface java.util.zip.ZipConstants |
|---|
CENATT, CENATX, CENCOM, CENCRC, CENDSK, CENEXT, CENFLG, CENHDR, CENHOW, CENLEN, CENNAM, CENOFF, CENSIG, CENSIZ, CENTIM, CENVEM, CENVER, ENDCOM, ENDHDR, ENDOFF, ENDSIG, ENDSIZ, ENDSUB, ENDTOT, EXTCRC, EXTHDR, EXTLEN, EXTSIG, EXTSIZ, LOCCRC, LOCEXT, LOCFLG, LOCHDR, LOCHOW, LOCLEN, LOCNAM, LOCSIG, LOCSIZ, LOCTIM, LOCVER |
| Constructor Summary | |
|---|---|
ZipFile(File file)
Constructs a new ZipFile opened on the specified File. |
|
ZipFile(File file,
int mode)
Open a Zip file. |
|
ZipFile(String name)
Open a Zip file. |
|
| Method Summary | |
|---|---|
void |
close()
Close the Zip file. |
Enumeration<? extends ZipEntry> |
entries()
Return an enumeration of the entries. |
protected void |
finalize()
Called by the virtual machine when there are no longer any (non-weak) references to the receiver. |
ZipEntry |
getEntry(String entryName)
Gets the zip entry with the specified name from this ZipFile. |
InputStream |
getInputStream(ZipEntry entry)
Returns an input stream on the data of the specified ZipEntry. |
String |
getName()
Gets the file name of this ZipFile. |
int |
size()
Returns the number of ZipEntries in this ZipFile. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
String fileName
File fileToDeleteOnClose
public static final int OPEN_READ
public static final int OPEN_DELETE
ZipEntry.LittleEndianReader ler
| Constructor Detail |
|---|
public ZipFile(File file)
throws ZipException,
IOException
file - the File
ZipException
IOException
public ZipFile(File file,
int mode)
throws IOException
IOException
public ZipFile(String name)
throws IOException
IOException| Method Detail |
|---|
protected void finalize()
throws IOException
ObjectNote: The virtual machine assumes that the implementation in class Object is empty.
finalize in class ObjectIOException
public void close()
throws IOException
IOExceptionpublic Enumeration<? extends ZipEntry> entries()
public ZipEntry getEntry(String entryName)
entryName - the name of the entry in the zip file
public InputStream getInputStream(ZipEntry entry)
throws IOException
entry - the ZipEntry
IOExceptionpublic String getName()
public int size()
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||