Team LiB
Previous Section Next Section

ZipEntryjava.util.zip

Java 1.1cloneable

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.

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[ ] extra);  
     public void setMethod(int method);  
     public void setSize(long size);  
     public void setTime(long time);  
// Public Methods Overriding Object
1.2  public Object clone( );  
1.2  public int hashCode( );  
     public String toString( );  
}

Subclasses

java.util.jar.JarEntry

Passed To

java.util.jar.JarEntry.JarEntry( ), java.util.jar.JarFile.getInputStream( ), java.util.jar.JarOutputStream.putNextEntry( ), ZipFile.getInputStream( ), ZipOutputStream.putNextEntry( )

Returned By

java.util.jar.JarFile.getEntry( ), java.util.jar.JarInputStream.{createZipEntry( ), getNextEnTRy( )}, ZipFile.getEntry( ), ZipInputStream.{createZipEntry( ), getNextEntry( )}

    Team LiB
    Previous Section Next Section