This class is used to represent a ZIP file entry.
Compression method for uncompressed entries.
public static final int STORED = 0;
Compression method for compressed (deflated) entries.
private static native void initIDs();
Creates a new zip entry with the specified name.
Creates a new zip entry with fields taken from the specified
zip entry.
- Parameters:
e a zip Entry object
Returns the name of the entry.
- Returns:
- the name of the entry
Sets the modification time of the entry.
- Parameters:
time the entry modification time in number of milliseconds
since the epoch- See also:
getTime()
Returns the modification time of the entry, or -1 if not specified.
- Returns:
- the modification time of the entry, or -1 if not specified
- See also:
setTime(long)
Sets the uncompressed size of the entry data.
if (size < 0 || size > 0xFFFFFFFFL) { Returns the uncompressed size of the entry data, or -1 if not known.
- Returns:
- the uncompressed size of the entry data, or -1 if not known
- See also:
setSize(long)
Returns the size of the compressed entry data, or -1 if not known.
In the case of a stored entry, the compressed size will be the same
as the uncompressed size of the entry.
Sets the size of the compressed entry data.
Sets the CRC-32 checksum of the uncompressed entry data.
public void setCrc(long crc) { if (crc < 0 || crc > 0xFFFFFFFFL) { Returns the CRC-32 checksum of the uncompressed entry data, or -1 if
not known.
- Returns:
- the CRC-32 checksum of the uncompressed entry data, or -1 if
not known
- See also:
setCrc(long)
Sets the compression method for the entry.
Returns the compression method of the entry, or -1 if not specified.
- Returns:
- the compression method of the entry, or -1 if not specified
- See also:
setMethod(int)
Sets the optional extra field data for the entry.
if (extra != null && extra.length > 0xFFFF) { Returns the extra field data for the entry, or null if none.
- Returns:
- the extra field data for the entry, or null if none
- See also:
setExtra(byte[])
Sets the optional comment string for the entry.
if (comment != null && comment.length() > 0xffff/3
Returns the comment string for the entry, or null if none.
Returns true if this is a directory entry. A directory entry is
defined to be one whose name ends with a '/'.
- Returns:
- true if this is a directory entry
Returns a string representation of the ZIP entry.
Date d = new Date((int)(((dtime >> 25) & 0x7f) + 80),
(int)(((dtime >> 21) & 0x0f) - 1),
(int)((dtime >> 16) & 0x1f),
(int)((dtime >> 11) & 0x1f),
(int)((dtime >> 5) & 0x3f),
(int)((dtime << 1) & 0x3e));
return (1 << 21) | (1 << 16);
return (year - 1980) << 25 | (d.getMonth() + 1) << 21 |
Returns the hash code value for this entry.
Returns a copy of this entry.