Package com.googlecode.d2j.util.zip
Class ZipEntry
java.lang.Object
com.googlecode.d2j.util.zip.ZipEntry
- All Implemented Interfaces:
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.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final longstatic final intstatic final intstatic final intstatic final intstatic final intZip entry state: Deflated.static final intstatic final intstatic final intstatic final longstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final longstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final longstatic final intstatic final intstatic final intstatic final intZip entry state: Stored. -
Method Summary
Modifier and TypeMethodDescriptionclone()Returns a deep copy of this zip entry.Returns the comment for thisandroid.ZipEntry, ornullif there is no comment.longGets the compressed size of thisandroid.ZipEntry.longgetCrc()Gets the checksum for thisandroid.ZipEntry.byte[]getExtra()Gets the extra information for thisandroid.ZipEntry.intGets the compression method for thisandroid.ZipEntry.getName()Gets the name of thisandroid.ZipEntry.longgetSize()Gets the uncompressed size of thisandroid.ZipEntry.longgetTime()Gets the last modification time of thisandroid.ZipEntry.booleanDetermine whether or not thisandroid.ZipEntryis a directory.toString()Returns the string representation of thisandroid.ZipEntry.
-
Field Details
-
DEFLATED
public static final int DEFLATEDZip entry state: Deflated.- See Also:
-
STORED
public static final int STOREDZip entry state: Stored.- See Also:
-
LOCSIG
static final long LOCSIG- See Also:
-
EXTSIG
static final long EXTSIG- See Also:
-
CENSIG
static final long CENSIG- See Also:
-
ENDSIG
static final long ENDSIG- See Also:
-
LOCHDR
static final int LOCHDR- See Also:
-
EXTHDR
static final int EXTHDR- See Also:
-
CENHDR
static final int CENHDR- See Also:
-
ENDHDR
static final int ENDHDR- See Also:
-
LOCVER
static final int LOCVER- See Also:
-
LOCFLG
static final int LOCFLG- See Also:
-
LOCHOW
static final int LOCHOW- See Also:
-
LOCTIM
static final int LOCTIM- See Also:
-
LOCCRC
static final int LOCCRC- See Also:
-
LOCSIZ
static final int LOCSIZ- See Also:
-
LOCLEN
static final int LOCLEN- See Also:
-
LOCNAM
static final int LOCNAM- See Also:
-
LOCEXT
static final int LOCEXT- See Also:
-
EXTCRC
static final int EXTCRC- See Also:
-
EXTSIZ
static final int EXTSIZ- See Also:
-
EXTLEN
static final int EXTLEN- See Also:
-
CENVEM
static final int CENVEM- See Also:
-
CENVER
static final int CENVER- See Also:
-
CENFLG
static final int CENFLG- See Also:
-
CENHOW
static final int CENHOW- See Also:
-
CENTIM
static final int CENTIM- See Also:
-
CENCRC
static final int CENCRC- See Also:
-
CENSIZ
static final int CENSIZ- See Also:
-
CENLEN
static final int CENLEN- See Also:
-
CENNAM
static final int CENNAM- See Also:
-
CENEXT
static final int CENEXT- See Also:
-
CENCOM
static final int CENCOM- See Also:
-
CENDSK
static final int CENDSK- See Also:
-
CENATT
static final int CENATT- See Also:
-
CENATX
static final int CENATX- See Also:
-
CENOFF
static final int CENOFF- See Also:
-
ENDSUB
static final int ENDSUB- See Also:
-
ENDTOT
static final int ENDTOT- See Also:
-
ENDSIZ
static final int ENDSIZ- See Also:
-
ENDOFF
static final int ENDOFF- See Also:
-
ENDCOM
static final int ENDCOM- See Also:
-
-
Method Details
-
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
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
Returns the string representation of thisandroid.ZipEntry. -
clone
Returns a deep copy of this zip entry.
-