Android
java.util.zip
public class

java.util.zip.ZipEntry

java.lang.Object
java.util.zip.ZipEntry Cloneable

ZipEntry represents an entry in a zip file.

Known Direct Subclasses

Summary

Constants

      Value  
int  CENATT    36  0x00000024 
int  CENATX    38  0x00000026 
int  CENCOM    32  0x00000020 
int  CENCRC    16  0x00000010 
int  CENDSK    34  0x00000022 
int  CENEXT    30  0x0000001e 
int  CENFLG    0x00000008 
int  CENHDR    46  0x0000002e 
int  CENHOW    10  0x0000000a 
int  CENLEN    24  0x00000018 
int  CENNAM    28  0x0000001c 
int  CENOFF    42  0x0000002a 
long  CENSIG    33639248  0x0000000002014b50 
int  CENSIZ    20  0x00000014 
int  CENTIM    12  0x0000000c 
int  CENVEM    0x00000004 
int  CENVER    0x00000006 
int  DEFLATED  Zip entry state: Deflated   0x00000008 
int  ENDCOM    20  0x00000014 
int  ENDHDR    22  0x00000016 
int  ENDOFF    16  0x00000010 
long  ENDSIG    101010256  0x0000000006054b50 
int  ENDSIZ    12  0x0000000c 
int  ENDSUB    0x00000008 
int  ENDTOT    10  0x0000000a 
int  EXTCRC    0x00000004 
int  EXTHDR    16  0x00000010 
int  EXTLEN    12  0x0000000c 
long  EXTSIG    134695760  0x0000000008074b50 
int  EXTSIZ    0x00000008 
int  LOCCRC    14  0x0000000e 
int  LOCEXT    28  0x0000001c 
int  LOCFLG    0x00000006 
int  LOCHDR    30  0x0000001e 
int  LOCHOW    0x00000008 
int  LOCLEN    22  0x00000016 
int  LOCNAM    26  0x0000001a 
long  LOCSIG    67324752  0x0000000004034b50 
int  LOCSIZ    18  0x00000012 
int  LOCTIM    10  0x0000000a 
int  LOCVER    0x00000004 
int  STORED  Zip entry state: Stored   0x00000000 

Public Constructors

            ZipEntry(String name)
Constructs a new ZipEntry with the specified name.
            ZipEntry(ZipEntry ze)
Constructs a new ZipEntry using the values obtained from ze.

Public Methods

          Object  clone()
Returns a shallow copy of this entry
          String  getComment()
Gets the comment for this ZipEntry.
          long  getCompressedSize()
Gets the compressed size of this ZipEntry.
          long  getCrc()
Gets the crc for this ZipEntry.
          byte[]  getExtra()
Gets the extra information for this ZipEntry.
          int  getMethod()
Gets the compression method for this ZipEntry.
          String  getName()
Gets the name of this ZipEntry.
          long  getSize()
Gets the uncompressed size of this ZipEntry.
          long  getTime()
Gets the last modification time of this ZipEntry.
          int  hashCode()
Returns the hashCode for this ZipEntry.
          boolean  isDirectory()
Determine whether or not this ZipEntry is a directory.
          void  setComment(String string)
Sets the comment for this ZipEntry.
          void  setCompressedSize(long value)
Sets the compressed size for this ZipEntry.
          void  setCrc(long value)
Sets the crc for this ZipEntry.
          void  setExtra(byte[] data)
Sets the extra information for this ZipEntry.
          void  setMethod(int value)
Sets the compression method for this ZipEntry.
          void  setSize(long value)
Sets the uncompressed size of this ZipEntry.
          void  setTime(long value)
Sets the last modification time of this ZipEntry.
          String  toString()
Returns the string representation of this ZipEntry.
Methods inherited from class java.lang.Object

Details

Constants

public static final int CENATT

Constant Value: 36 (0x00000024)

public static final int CENATX

Constant Value: 38 (0x00000026)

public static final int CENCOM

Constant Value: 32 (0x00000020)

public static final int CENCRC

Constant Value: 16 (0x00000010)

public static final int CENDSK

Constant Value: 34 (0x00000022)

public static final int CENEXT

Constant Value: 30 (0x0000001e)

public static final int CENFLG

Constant Value: 8 (0x00000008)

public static final int CENHDR

Constant Value: 46 (0x0000002e)

public static final int CENHOW

Constant Value: 10 (0x0000000a)

public static final int CENLEN

Constant Value: 24 (0x00000018)

public static final int CENNAM

Constant Value: 28 (0x0000001c)

public static final int CENOFF

Constant Value: 42 (0x0000002a)

public static final long CENSIG

Constant Value: 33639248 (0x0000000002014b50)

public static final int CENSIZ

Constant Value: 20 (0x00000014)

public static final int CENTIM

Constant Value: 12 (0x0000000c)

public static final int CENVEM

Constant Value: 4 (0x00000004)

public static final int CENVER

Constant Value: 6 (0x00000006)

public static final int DEFLATED

Zip entry state: Deflated
Constant Value: 8 (0x00000008)

public static final int ENDCOM

Constant Value: 20 (0x00000014)

public static final int ENDHDR

Constant Value: 22 (0x00000016)

public static final int ENDOFF

Constant Value: 16 (0x00000010)

public static final long ENDSIG

Constant Value: 101010256 (0x0000000006054b50)

public static final int ENDSIZ

Constant Value: 12 (0x0000000c)

public static final int ENDSUB

Constant Value: 8 (0x00000008)

public static final int ENDTOT

Constant Value: 10 (0x0000000a)

public static final int EXTCRC

Constant Value: 4 (0x00000004)

public static final int EXTHDR

Constant Value: 16 (0x00000010)

public static final int EXTLEN

Constant Value: 12 (0x0000000c)

public static final long EXTSIG

Constant Value: 134695760 (0x0000000008074b50)

public static final int EXTSIZ

Constant Value: 8 (0x00000008)

public static final int LOCCRC

Constant Value: 14 (0x0000000e)

public static final int LOCEXT

Constant Value: 28 (0x0000001c)

public static final int LOCFLG

Constant Value: 6 (0x00000006)

public static final int LOCHDR

Constant Value: 30 (0x0000001e)

public static final int LOCHOW

Constant Value: 8 (0x00000008)

public static final int LOCLEN

Constant Value: 22 (0x00000016)

public static final int LOCNAM

Constant Value: 26 (0x0000001a)

public static final long LOCSIG

Constant Value: 67324752 (0x0000000004034b50)

public static final int LOCSIZ

Constant Value: 18 (0x00000012)

public static final int LOCTIM

Constant Value: 10 (0x0000000a)

public static final int LOCVER

Constant Value: 4 (0x00000004)

public static final int STORED

Zip entry state: Stored
Constant Value: 0 (0x00000000)

Public Constructors

public ZipEntry(String name)

Constructs a new ZipEntry with the specified name.

Parameters

name the name of the zip entry

public ZipEntry(ZipEntry ze)

Constructs a new ZipEntry using the values obtained from ze.

Parameters

ze ZipEntry from which to obtain values.

Public Methods

public Object clone()

Returns a shallow copy of this entry

Returns

  • a copy of this entry

public String getComment()

Gets the comment for this ZipEntry.

Returns

  • the comment for this ZipEntry, or null if there is no comment Note the comment does not live in the LFH, only the CDE. This means that, if we're reading an archive with ZipInputStream, we won't be able to see the comments.

public long getCompressedSize()

Gets the compressed size of this ZipEntry.

Returns

  • the compressed size, or -1 if the compressed size has not been set

public long getCrc()

Gets the crc for this ZipEntry.

Returns

  • the crc, or -1 if the crc has not been set

public byte[] getExtra()

Gets the extra information for this ZipEntry.

Returns

  • a byte array containing the extra information, or null if there is none

public int getMethod()

Gets the compression method for this ZipEntry.

Returns

  • the compression method, either DEFLATED, STORED or -1 if the compression method has not been set

public String getName()

Gets the name of this ZipEntry.

Returns

  • the entry name

public long getSize()

Gets the uncompressed size of this ZipEntry.

Returns

  • the uncompressed size, or -1 if the size has not been set

public long getTime()

Gets the last modification time of this ZipEntry.

Returns

  • the last modification time as the number of milliseconds since Jan. 1, 1970

public int hashCode()

Returns the hashCode for this ZipEntry.

Returns

  • the hashCode of the entry

public boolean isDirectory()

Determine whether or not this ZipEntry is a directory.

Returns

  • true when this ZipEntry is a directory, false otherwise

public void setComment(String string)

Sets the comment for this ZipEntry.

Parameters

string the comment

public void setCompressedSize(long value)

Sets the compressed size for this ZipEntry.

Parameters

value the compressed size

public void setCrc(long value)

Sets the crc for this ZipEntry.

Parameters

value the crc

Throws

IllegalArgumentException if value is < 0 or > 0xFFFFFFFFL

public void setExtra(byte[] data)

Sets the extra information for this ZipEntry.

Parameters

data a byte array containing the extra information

Throws

IllegalArgumentException when the length of data is > 0xFFFF bytes

public void setMethod(int value)

Sets the compression method for this ZipEntry.

Parameters

value the compression method, either DEFLATED or STORED

Throws

IllegalArgumentException when value is not DEFLATED or STORED

public void setSize(long value)

Sets the uncompressed size of this ZipEntry.

Parameters

value the uncompressed size

Throws

IllegalArgumentException if value is < 0 or > 0xFFFFFFFFL

public void setTime(long value)

Sets the last modification time of this ZipEntry.

Parameters

value the last modification time as the number of milliseconds since Jan. 1, 1970

public String toString()

Returns the string representation of this ZipEntry.

Returns

  • the string representation of this ZipEntry
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:56