| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Enumeration entries = …;
ZipEntry entry = (ZipEntry)entries.nextElement();
Based on 74 examples
public class ZipEntry extends Object implements ZipConstants, Cloneable
This class is used to represent a ZIP file entry.
Field Summary | |
---|---|
static int |
DEFLATED
Compression method for compressed (deflated) entries. |
static int |
STORED
Compression method for uncompressed entries. |
Constructor Summary | |
---|---|
Creates a new zip entry with the specified name. |
|
Creates a new zip entry with fields taken from the specified zip entry. |
Method Summary | |
---|---|
Object |
clone() Returns a copy of this entry. |
String |
Returns the comment string for the entry, or null if none. |
long |
Returns the size of the compressed entry data, or -1 if not known. |
long |
getCrc() Returns the CRC-32 checksum of the uncompressed entry data, or -1 if not known. |
byte[] |
getExtra() Returns the extra field data for the entry, or null if none. |
int |
Returns the compression method of the entry, or -1 if not specified. |
String |
getName() Returns the name of the entry. |
long |
getSize() Returns the uncompressed size of the entry data, or -1 if not known. |
long |
getTime() Returns the modification time of the entry, or -1 if not specified. |
int |
hashCode() Returns the hash code value for this entry. |
boolean |
Returns true if this is a directory entry. |
void |
setComment(String comment) Sets the optional comment string for the entry. |
void |
setCompressedSize(long csize) Sets the size of the compressed entry data. |
void |
setCrc(long crc) Sets the CRC-32 checksum of the uncompressed entry data. |
void |
setExtra(byte[] extra) Sets the optional extra field data for the entry. |
void |
setMethod(int method) Sets the compression method for the entry. |
void |
setSize(long size) Sets the uncompressed size of the entry data. |
void |
setTime(long time) Sets the modification time of the entry. |
String |
toString() Returns a string representation of the ZIP entry. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFLATED
public static final int STORED
Constructor Detail |
---|
public ZipEntry(String name)
name
- the entry namepublic ZipEntry(ZipEntry e)
e
- a zip Entry objectMethod Detail |
---|
public Object clone()
clone
in class Object
public String getComment()
public long getCompressedSize()
public long getCrc()
public byte[] getExtra()
public int getMethod()
public String getName()
public long getSize()
public long getTime()
public int hashCode()
hashCode
in class Object
public boolean isDirectory()
public void setComment(String comment)
comment
- the comment stringpublic void setCompressedSize(long csize)
csize
- the compressed size to set topublic void setCrc(long crc)
crc
- the CRC-32 valuepublic void setExtra(byte[] extra)
extra
- the extra field data bytespublic void setMethod(int method)
method
- the compression method, either STORED or DEFLATEDpublic void setSize(long size)
size
- the uncompressed size in bytespublic void setTime(long time)
time
- the entry modification time in number of milliseconds
since the epochpublic String toString()
toString
in class Object
| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |