Package com.googlecode.d2j.util.zip
Class ZipEntry
- java.lang.Object
-
- com.googlecode.d2j.util.zip.ZipEntry
-
- All Implemented Interfaces:
java.lang.Cloneable
public final class ZipEntry extends java.lang.Object implements java.lang.CloneableAn 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 withZipFile.getInputStream(java.util.zip.ZipEntry). The class documentation forZipInputStreamandZipOutputStreamshows howandroid.ZipEntryis used in conjunction with those two classes.
-
-
Field Summary
Fields Modifier and Type Field Description static intCENATTstatic intCENATXstatic intCENCOMstatic intCENCRCstatic intCENDSKstatic intCENEXTstatic intCENFLGstatic intCENHDRstatic intCENHOWstatic intCENLENstatic intCENNAMstatic intCENOFFstatic longCENSIGstatic intCENSIZstatic intCENTIMstatic intCENVEMstatic intCENVERstatic intDEFLATEDZip entry state: Deflated.static intENDCOMstatic intENDHDRstatic intENDOFFstatic longENDSIGstatic intENDSIZstatic intENDSUBstatic intENDTOTstatic intEXTCRCstatic intEXTHDRstatic intEXTLENstatic longEXTSIGstatic intEXTSIZstatic intLOCCRCstatic intLOCEXTstatic intLOCFLGstatic intLOCHDRstatic intLOCHOWstatic intLOCLENstatic intLOCNAMstatic longLOCSIGstatic intLOCSIZstatic intLOCTIMstatic intLOCVERstatic intSTOREDZip entry state: Stored.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()Returns a deep copy of this zip entry.java.lang.StringgetComment()Returns the comment for thisandroid.ZipEntry, ornullif there is no comment.longgetCompressedSize()Gets the compressed size of thisandroid.ZipEntry.longgetCrc()Gets the checksum for thisandroid.ZipEntry.byte[]getExtra()Gets the extra information for thisandroid.ZipEntry.intgetMethod()Gets the compression method for thisandroid.ZipEntry.java.lang.StringgetName()Gets the name of thisandroid.ZipEntry.longgetSize()Gets the uncompressed size of thisandroid.ZipEntry.longgetTime()Gets the last modification time of thisandroid.ZipEntry.booleanisDirectory()Determine whether or not thisandroid.ZipEntryis a directory.java.lang.StringtoString()Returns the string representation of thisandroid.ZipEntry.
-
-
-
Field Detail
-
DEFLATED
public static final int DEFLATED
Zip entry state: Deflated.- See Also:
- Constant Field Values
-
STORED
public static final int STORED
Zip entry state: Stored.- See Also:
- Constant Field Values
-
LOCSIG
public static final long LOCSIG
- See Also:
- Constant Field Values
-
EXTSIG
public static final long EXTSIG
- See Also:
- Constant Field Values
-
CENSIG
public static final long CENSIG
- See Also:
- Constant Field Values
-
ENDSIG
public static final long ENDSIG
- See Also:
- Constant Field Values
-
LOCHDR
public static final int LOCHDR
- See Also:
- Constant Field Values
-
EXTHDR
public static final int EXTHDR
- See Also:
- Constant Field Values
-
CENHDR
public static final int CENHDR
- See Also:
- Constant Field Values
-
ENDHDR
public static final int ENDHDR
- See Also:
- Constant Field Values
-
LOCVER
public static final int LOCVER
- See Also:
- Constant Field Values
-
LOCFLG
public static final int LOCFLG
- See Also:
- Constant Field Values
-
LOCHOW
public static final int LOCHOW
- See Also:
- Constant Field Values
-
LOCTIM
public static final int LOCTIM
- See Also:
- Constant Field Values
-
LOCCRC
public static final int LOCCRC
- See Also:
- Constant Field Values
-
LOCSIZ
public static final int LOCSIZ
- See Also:
- Constant Field Values
-
LOCLEN
public static final int LOCLEN
- See Also:
- Constant Field Values
-
LOCNAM
public static final int LOCNAM
- See Also:
- Constant Field Values
-
LOCEXT
public static final int LOCEXT
- See Also:
- Constant Field Values
-
EXTCRC
public static final int EXTCRC
- See Also:
- Constant Field Values
-
EXTSIZ
public static final int EXTSIZ
- See Also:
- Constant Field Values
-
EXTLEN
public static final int EXTLEN
- See Also:
- Constant Field Values
-
CENVEM
public static final int CENVEM
- See Also:
- Constant Field Values
-
CENVER
public static final int CENVER
- See Also:
- Constant Field Values
-
CENFLG
public static final int CENFLG
- See Also:
- Constant Field Values
-
CENHOW
public static final int CENHOW
- See Also:
- Constant Field Values
-
CENTIM
public static final int CENTIM
- See Also:
- Constant Field Values
-
CENCRC
public static final int CENCRC
- See Also:
- Constant Field Values
-
CENSIZ
public static final int CENSIZ
- See Also:
- Constant Field Values
-
CENLEN
public static final int CENLEN
- See Also:
- Constant Field Values
-
CENNAM
public static final int CENNAM
- See Also:
- Constant Field Values
-
CENEXT
public static final int CENEXT
- See Also:
- Constant Field Values
-
CENCOM
public static final int CENCOM
- See Also:
- Constant Field Values
-
CENDSK
public static final int CENDSK
- See Also:
- Constant Field Values
-
CENATT
public static final int CENATT
- See Also:
- Constant Field Values
-
CENATX
public static final int CENATX
- See Also:
- Constant Field Values
-
CENOFF
public static final int CENOFF
- See Also:
- Constant Field Values
-
ENDSUB
public static final int ENDSUB
- See Also:
- Constant Field Values
-
ENDTOT
public static final int ENDTOT
- See Also:
- Constant Field Values
-
ENDSIZ
public static final int ENDSIZ
- See Also:
- Constant Field Values
-
ENDOFF
public static final int ENDOFF
- See Also:
- Constant Field Values
-
ENDCOM
public static final int ENDCOM
- See Also:
- Constant Field Values
-
-
Method Detail
-
getComment
public java.lang.String getComment()
Returns the comment for thisandroid.ZipEntry, ornullif there is no comment. If we're reading a zip file usingZipInputStream, the comment is not available.
-
getCompressedSize
public long getCompressedSize()
Gets the compressed size of thisandroid.ZipEntry.- Returns:
- the compressed size, or -1 if the compressed size has not been set.
-
getCrc
public long getCrc()
Gets the checksum for thisandroid.ZipEntry.- Returns:
- the checksum, or -1 if the checksum has not been set.
-
getExtra
public byte[] getExtra()
Gets the extra information for thisandroid.ZipEntry.- Returns:
- a byte array containing the extra information, or
nullif there is none.
-
getMethod
public int getMethod()
Gets the compression method for thisandroid.ZipEntry.- Returns:
- the compression method, either
DEFLATED,STOREDor -1 if the compression method has not been set.
-
getName
public java.lang.String getName()
Gets the name of thisandroid.ZipEntry.- Returns:
- the entry name.
-
getSize
public long getSize()
Gets the uncompressed size of thisandroid.ZipEntry.- Returns:
- the uncompressed size, or
-1if the size has not been set.
-
getTime
public long getTime()
Gets the last modification time of thisandroid.ZipEntry.- Returns:
- the last modification time as the number of milliseconds since Jan. 1, 1970.
-
isDirectory
public boolean isDirectory()
Determine whether or not thisandroid.ZipEntryis a directory.- Returns:
truewhen thisandroid.ZipEntryis a directory,falseotherwise.
-
toString
public java.lang.String toString()
Returns the string representation of thisandroid.ZipEntry.- Overrides:
toStringin classjava.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:
clonein classjava.lang.Object
-
-