Home » openjdk-7 » java » util » zip » [javadoc | source]
java.util.zip
public class: ZipEntry [javadoc | source]
java.lang.Object
   java.util.zip.ZipEntry

All Implemented Interfaces:
    ZipConstants, Cloneable

Direct Known Subclasses:
    JarFileEntry, JarEntry

This class is used to represent a ZIP file entry.
Field Summary
 String name     
 long time     
 long crc     
 long size     
 long csize     
 int method     
 int flag     
 byte[] extra     
 String comment     
public static final  int STORED    Compression method for uncompressed entries. 
public static final  int DEFLATED    Compression method for compressed (deflated) entries. 
Constructor:
 ZipEntry() 
 public ZipEntry(String name) 
    Creates a new zip entry with the specified name.
    Parameters:
    name - the entry name
    Throws:
    NullPointerException - if the entry name is null
    IllegalArgumentException - if the entry name is longer than 0xFFFF bytes
    exception: NullPointerException - if the entry name is null
    exception: IllegalArgumentException - if the entry name is longer than 0xFFFF bytes
 public ZipEntry(ZipEntry e) 
    Creates a new zip entry with fields taken from the specified zip entry.
    Parameters:
    e - a zip Entry object
Method from java.util.zip.ZipEntry Summary:
clone,   getComment,   getCompressedSize,   getCrc,   getExtra,   getMethod,   getName,   getSize,   getTime,   hashCode,   isDirectory,   setComment,   setCompressedSize,   setCrc,   setExtra,   setMethod,   setSize,   setTime,   toString
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from java.util.zip.ZipEntry Detail:
 public Object clone() 
    Returns a copy of this entry.
 public String getComment() 
    Returns the comment string for the entry, or null if none.
 public long getCompressedSize() 
    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.
 public long getCrc() 
    Returns the CRC-32 checksum of the uncompressed entry data, or -1 if not known.
 public byte[] getExtra() 
    Returns the extra field data for the entry, or null if none.
 public int getMethod() 
    Returns the compression method of the entry, or -1 if not specified.
 public String getName() 
    Returns the name of the entry.
 public long getSize() 
    Returns the uncompressed size of the entry data, or -1 if not known.
 public long getTime() 
    Returns the modification time of the entry, or -1 if not specified.
 public int hashCode() 
    Returns the hash code value for this entry.
 public boolean isDirectory() 
    Returns true if this is a directory entry. A directory entry is defined to be one whose name ends with a '/'.
 public  void setComment(String comment) 
    Sets the optional comment string for the entry.

    ZIP entry comments have maximum length of 0xffff. If the length of the specified comment string is greater than 0xFFFF bytes after encoding, only the first 0xFFFF bytes are output to the ZIP file entry.

 public  void setCompressedSize(long csize) 
    Sets the size of the compressed entry data.
 public  void setCrc(long crc) 
    Sets the CRC-32 checksum of the uncompressed entry data.
 public  void setExtra(byte[] extra) 
    Sets the optional extra field data for the entry.
 public  void setMethod(int method) 
    Sets the compression method for the entry.
 public  void setSize(long size) 
    Sets the uncompressed size of the entry data.
 public  void setTime(long time) 
    Sets the modification time of the entry.
 public String toString() 
    Returns a string representation of the ZIP entry.