This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


java.util.zip
class ZipEntry

java.lang.Object extended by java.util.zip.ZipEntry
All Implemented Interfaces:
Cloneable, ZipConstants
Direct Known Subclasses:
JarEntry

Most common way to construct:

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

          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

          Returns the CRC-32 checksum of the uncompressed entry data, or -1 if not known.
 byte[]

          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

          Returns the name of the entry.
 long

          Returns the uncompressed size of the entry data, or -1 if not known.
 long

          Returns the modification time of the entry, or -1 if not specified.
 int

          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

          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

DEFLATED

public static final int DEFLATED
Compression method for compressed (deflated) entries.

STORED

public static final int STORED
Compression method for uncompressed entries.
Constructor Detail

ZipEntry

public ZipEntry(String name)
Creates a new zip entry with the specified name.

Parameters:
name - the entry name

ZipEntry

public ZipEntry(ZipEntry e)
Creates a new zip entry with fields taken from the specified zip entry.

Parameters:
e - a zip Entry object
Method Detail

clone

public Object clone()
Returns a copy of this entry.

Overrides:
clone in class Object

getComment

public String getComment()
Returns the comment string for the entry, or null if none.

Returns:
the comment string for the entry, or null if none

getCompressedSize

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.

Returns:
the size of the compressed entry data, or -1 if not known

getCrc

public long getCrc()
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

getExtra

public byte[] getExtra()
Returns the extra field data for the entry, or null if none.

Returns:
the extra field data for the entry, or null if none

getMethod

public int getMethod()
Returns the compression method of the entry, or -1 if not specified.

Returns:
the compression method of the entry, or -1 if not specified

getName

public String getName()
Returns the name of the entry.

Returns:
the name of the entry

getSize

public long getSize()
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

getTime

public long 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

hashCode

public int hashCode()
Returns the hash code value for this entry.

Overrides:
hashCode in class Object

isDirectory

public boolean isDirectory()
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

setComment

public void setComment(String comment)
Sets the optional comment string for the entry.

Parameters:
comment - the comment string

setCompressedSize

public void setCompressedSize(long csize)
Sets the size of the compressed entry data.

Parameters:
csize - the compressed size to set to

setCrc

public void setCrc(long crc)
Sets the CRC-32 checksum of the uncompressed entry data.

Parameters:
crc - the CRC-32 value

setExtra

public void setExtra(byte[] extra)
Sets the optional extra field data for the entry.

Parameters:
extra - the extra field data bytes

setMethod

public void setMethod(int method)
Sets the compression method for the entry.

Parameters:
method - the compression method, either STORED or DEFLATED

setSize

public void setSize(long size)
Sets the uncompressed size of the entry data.

Parameters:
size - the uncompressed size in bytes

setTime

public void setTime(long time)
Sets the modification time of the entry.

Parameters:
time - the entry modification time in number of milliseconds since the epoch

toString

public String toString()
Returns a string representation of the ZIP entry.

Overrides:
toString in class Object


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.