Name

ZipEntry

Synopsis

This class describes a single entry (typically a compressed file) stored within a ZIP file. The various methods get and set various pieces of information about the entry. The ZipEntry class is used by ZipFile and ZipInputStream, which read ZIP files, and by ZipOutputStream, which writes ZIP files.

When you are reading a ZIP file, a ZipEntry object returned by ZipFile or ZipInputStream contains the name, size, modification time, and other information about an entry in the file. When writing a ZIP file, on the other hand, you must create your own ZipEntry objects and initialize them to contain the entry name and other appropriate information before writing the contents of the entry.

java.util.zip.ZipEntry

Figure 16-143. java.util.zip.ZipEntry

public class ZipEntry implements Cloneable, ZipConstants {
// Public Constructors
     public ZipEntry(String name);  
1.2  public ZipEntry(ZipEntry e);  
// Public Constants
     public static final int DEFLATED;                                   =8
     public static final int STORED;                                     =0
                  // Public Instance Methods
     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 boolean isDirectory( );  
     public void setComment(String comment);  
1.2  public void setCompressedSize(long csize);  
     public void setCrc(long crc);  
     public void setExtra(byte[ ]  ...

Get Java in a Nutshell, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.