|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectewe.util.Errorable
ewe.zip.ZipFile
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 RandomAccessStream |
raf
|
ZipEntry |
root
|
String |
zipName
|
| Fields inherited from class ewe.util.Errorable |
error |
| Constructor Summary | |
ZipFile(File file)
Opens a Zip file with the given name for reading. |
|
ZipFile(RandomAccessStream stream)
Opens a Zip file from the RandomAccessStream. |
|
ZipFile(RandomAccessStream stream,
Handle h)
This should only be called from a Coroutine if the handle is not null. |
|
ZipFile(String name)
Opens a Zip file reading the given File. |
|
| Method Summary | |
boolean |
close()
Closes the ZipFile. |
int |
compare(Object one,
Object two)
This should compare the two objects and return: 0 = the objects are equal. |
Iterator |
entries()
Returns an iterator of all Zip entries in this Zip file. |
ZipEntry |
getEntry(int which)
|
ZipEntry |
getEntry(String name)
Searches for a zip entry in this archive with the given name. |
Stream |
getInputStream(ZipEntry entry)
Creates an input stream reading the given zip entry as uncompressed data. |
String |
getName()
Returns the name of this zip file. |
boolean |
isOpen()
Call this after creating the ZipFile to ensure that it was opened properly. |
int |
size()
Returns the number of entries in this zip file. |
| Methods inherited from class ewe.util.Errorable |
returnError, returnError, returnError |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, toString |
| Field Detail |
protected RandomAccessStream raf
public String zipName
public ZipEntry root
| Constructor Detail |
public ZipFile(RandomAccessStream stream)
public ZipFile(File file)
throws IOException
IOException - if a i/o error occured.
ZipException - if the file doesn't contain a valid zip
archive.
public ZipFile(String name)
throws IOException
IOException - if a i/o error occured.
ZipException - if the file doesn't contain a valid zip
archive.
public ZipFile(RandomAccessStream stream,
Handle h)
| Method Detail |
public int compare(Object one,
Object two)
Comparer
compare in interface Comparerpublic boolean isOpen()
public boolean close()
IOException - if a i/o error occured.public Iterator entries()
public ZipEntry getEntry(String name)
entries()public Stream getInputStream(ZipEntry entry)
public String getName()
public int size()
public ZipEntry getEntry(int which)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||