Class ZipEntry

  • All Implemented Interfaces:
    java.lang.Cloneable

    public final class ZipEntry
    extends java.lang.Object
    implements java.lang.Cloneable
    An entry within a zip file. An entry has attributes such as its name (which is actually a path) and the uncompressed size of the corresponding data. An entry does not contain the data itself, but can be used as a key with ZipFile.getInputStream(java.util.zip.ZipEntry). The class documentation for ZipInputStream and ZipOutputStream shows how android.ZipEntry is used in conjunction with those two classes.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object clone()
      Returns a deep copy of this zip entry.
      java.lang.String getComment()
      Returns the comment for this android.ZipEntry, or null if there is no comment.
      long getCompressedSize()
      Gets the compressed size of this android.ZipEntry.
      long getCrc()
      Gets the checksum for this android.ZipEntry.
      byte[] getExtra()
      Gets the extra information for this android.ZipEntry.
      int getMethod()
      Gets the compression method for this android.ZipEntry.
      java.lang.String getName()
      Gets the name of this android.ZipEntry.
      long getSize()
      Gets the uncompressed size of this android.ZipEntry.
      long getTime()
      Gets the last modification time of this android.ZipEntry.
      boolean isDirectory()
      Determine whether or not this android.ZipEntry is a directory.
      java.lang.String toString()
      Returns the string representation of this android.ZipEntry.
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • getComment

        public java.lang.String getComment()
        Returns the comment for this android.ZipEntry, or null if there is no comment. If we're reading a zip file using ZipInputStream, the comment is not available.
      • getCompressedSize

        public long getCompressedSize()
        Gets the compressed size of this android.ZipEntry.
        Returns:
        the compressed size, or -1 if the compressed size has not been set.
      • getCrc

        public long getCrc()
        Gets the checksum for this android.ZipEntry.
        Returns:
        the checksum, or -1 if the checksum has not been set.
      • getExtra

        public byte[] getExtra()
        Gets the extra information for this android.ZipEntry.
        Returns:
        a byte array containing the extra information, or null if there is none.
      • getMethod

        public int getMethod()
        Gets the compression method for this android.ZipEntry.
        Returns:
        the compression method, either DEFLATED, STORED or -1 if the compression method has not been set.
      • getName

        public java.lang.String getName()
        Gets the name of this android.ZipEntry.
        Returns:
        the entry name.
      • getSize

        public long getSize()
        Gets the uncompressed size of this android.ZipEntry.
        Returns:
        the uncompressed size, or -1 if the size has not been set.
      • getTime

        public long getTime()
        Gets the last modification time of this android.ZipEntry.
        Returns:
        the last modification time as the number of milliseconds since Jan. 1, 1970.
      • isDirectory

        public boolean isDirectory()
        Determine whether or not this android.ZipEntry is a directory.
        Returns:
        true when this android.ZipEntry is a directory, false otherwise.
      • toString

        public java.lang.String toString()
        Returns the string representation of this android.ZipEntry.
        Overrides:
        toString in class java.lang.Object
        Returns:
        the string representation of this android.ZipEntry.
      • clone

        public java.lang.Object clone()
        Returns a deep copy of this zip entry.
        Overrides:
        clone in class java.lang.Object