public class ZipEntry
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFLATED
Compression method.
|
static int |
STORED
Compression method.
|
Constructor and Description |
---|
ZipEntry(java.lang.String name)
Creates a new zip entry with the specified name.
|
ZipEntry(ZipEntry e)
Creates a new zip entry with fields taken from the specified zip entry.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getComment()
Returns the comment string for the entry, or null if none.
|
long |
getCompressedSize()
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 |
getMethod()
Returns the compression method of the entry, or -1 if not specified.
|
java.lang.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 |
isDirectory()
Returns true if this is a directory entry.
|
void |
setComment(java.lang.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.
|
java.lang.String |
toString()
Returns a string representation of the ZIP entry.
|
public static final int STORED
public static final int DEFLATED
public ZipEntry(java.lang.String name)
name
- the entry namejava.lang.NullPointerException
- if the entry name is nulljava.lang.IllegalArgumentException
- if the entry name is longer than 0xFFFF bytespublic ZipEntry(ZipEntry e)
e
- a zip Entry objectpublic java.lang.String getName()
public void setTime(long time)
time
- the entry modification time in number of milliseconds since the epochpublic long getTime()
public void setSize(long size)
size
- the uncompressed size in bytesjava.lang.IllegalArgumentException
- if the specified size is less than 0 or greater than 0xFFFFFFFF bytespublic long getSize()
public void setCompressedSize(long csize)
csize
- the compressed size to set topublic long getCompressedSize()
public void setCrc(long crc)
crc
- the CRC-32 valuejava.lang.IllegalArgumentException
- if the specified CRC-32 value is less than 0 or greater than 0xFFFFFFFFpublic long getCrc()
public void setMethod(int method)
method
- the compression method, either STORED or DEFLATEDjava.lang.IllegalArgumentException
- if the specified compression method is invalidpublic int getMethod()
public void setExtra(byte[] extra)
extra
- the extra field data bytesjava.lang.IllegalArgumentException
- if the length of the specified extra field data is greater than 0xFFFF bytespublic byte[] getExtra()
public void setComment(java.lang.String comment)
comment
- the comment stringjava.lang.IllegalArgumentException
- if the length of the specified comment string is greater than 0xFFFF bytespublic java.lang.String getComment()
public boolean isDirectory()
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object