|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.zip.ZipEntry
org.apache.commons.compress.archivers.zip.ZipEntry
public class ZipEntry
Extension that adds better handling of extra fields and provides access to the internal and external file attributes.
Field Summary | |
---|---|
static int |
CENATT
|
static int |
CENATX
|
static int |
CENCOM
|
static int |
CENCRC
|
static int |
CENDSK
|
static int |
CENEXT
|
static int |
CENFLG
|
static int |
CENHDR
|
static int |
CENHOW
|
static int |
CENLEN
|
static int |
CENNAM
|
static int |
CENOFF
|
static long |
CENSIG
|
static int |
CENSIZ
|
static int |
CENTIM
|
static int |
CENVEM
|
static int |
CENVER
|
static int |
ENDCOM
|
static int |
ENDHDR
|
static int |
ENDOFF
|
static long |
ENDSIG
|
static int |
ENDSIZ
|
static int |
ENDSUB
|
static int |
ENDTOT
|
static int |
EXTCRC
|
static int |
EXTHDR
|
static int |
EXTLEN
|
static long |
EXTSIG
|
static int |
EXTSIZ
|
static int |
LOCCRC
|
static int |
LOCEXT
|
static int |
LOCFLG
|
static int |
LOCHDR
|
static int |
LOCHOW
|
static int |
LOCLEN
|
static int |
LOCNAM
|
static long |
LOCSIG
|
static int |
LOCSIZ
|
static int |
LOCTIM
|
static int |
LOCVER
|
Fields inherited from class java.util.zip.ZipEntry |
---|
DEFLATED, STORED |
Constructor Summary | |
---|---|
ZipEntry(String name)
Creates a new zip entry with the specified name. |
|
ZipEntry(ZipEntry entry)
Creates a new zip entry with fields taken from the specified zip entry. |
|
ZipEntry(ZipEntry entry)
Creates a new zip entry with fields taken from the specified zip entry. |
Method Summary | |
---|---|
void |
addExtraField(ZipExtraField extraField)
Adds an extra fields - replacing an already present extra field of the same type. |
Object |
clone()
Overwrite clone |
byte[] |
getCentralDirectoryExtra()
Retrieves the extra data for the central directory. |
long |
getCompressedSize()
Override to make this class work in JDK 1.1 like a 1.2 class. |
long |
getExternalAttributes()
Retrieves the external file attributes. |
ZipExtraField[] |
getExtraFields()
Retrieves extra fields. |
int |
getInternalAttributes()
Retrieves the internal file attributes. |
byte[] |
getLocalFileDataExtra()
Retrieves the extra data for the local file data. |
void |
removeExtraField(ZipShort type)
Remove an extra fields. |
void |
setComprSize(long size)
Make this class work in JDK 1.1 like a 1.2 class. |
void |
setExternalAttributes(long externalAttributes)
Sets the external file attributes. |
protected void |
setExtra()
Unfortunately java.util.zip.ZipOutputStream seems to access the extra data directly,
so overriding getExtra doesn't help - we need to modify super's data
directly. |
void |
setExtra(byte[] extra)
Throws an Exception if extra data cannot be parsed into extra fields. |
void |
setExtraFields(ZipExtraField[] fields)
Replaces all currently attached extra fields with the new array. |
void |
setInternalAttributes(int value)
Sets the internal file attributes. |
Methods inherited from class java.util.zip.ZipEntry |
---|
getComment, getCrc, getExtra, getMethod, getName, getSize, getTime, hashCode, isDirectory, setComment, setCompressedSize, setCrc, setMethod, setSize, setTime, toString |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final long LOCSIG
public static final long EXTSIG
public static final long CENSIG
public static final long ENDSIG
public static final int LOCHDR
public static final int EXTHDR
public static final int CENHDR
public static final int ENDHDR
public static final int LOCVER
public static final int LOCFLG
public static final int LOCHOW
public static final int LOCTIM
public static final int LOCCRC
public static final int LOCSIZ
public static final int LOCLEN
public static final int LOCNAM
public static final int LOCEXT
public static final int EXTCRC
public static final int EXTSIZ
public static final int EXTLEN
public static final int CENVEM
public static final int CENVER
public static final int CENFLG
public static final int CENHOW
public static final int CENTIM
public static final int CENCRC
public static final int CENSIZ
public static final int CENLEN
public static final int CENNAM
public static final int CENEXT
public static final int CENCOM
public static final int CENDSK
public static final int CENATT
public static final int CENATX
public static final int CENOFF
public static final int ENDSUB
public static final int ENDTOT
public static final int ENDSIZ
public static final int ENDOFF
public static final int ENDCOM
Constructor Detail |
---|
public ZipEntry(String name)
name
- the name of entrypublic ZipEntry(ZipEntry entry) throws ZipException
entry
- the JDK ZipEntry to adapt
ZipException
- if can not create entrypublic ZipEntry(ZipEntry entry) throws ZipException
entry
- the entry to adapt
ZipException
- if can not create entryMethod Detail |
---|
public void setComprSize(long size)
This either stores the size for later usage or invokes setCompressedSize via reflection.
size
- The new ComprSize valuepublic void setExternalAttributes(long externalAttributes)
externalAttributes
- The new ExternalAttributes valuepublic void setExtra(byte[] extra) throws RuntimeException
setExtra
in class ZipEntry
extra
- The new Extra value
RuntimeException
- if fail to set extra datapublic void setExtraFields(ZipExtraField[] fields)
fields
- The new ExtraFields valuepublic void setInternalAttributes(int value)
value
- The new InternalAttributes valuepublic byte[] getCentralDirectoryExtra()
public long getCompressedSize()
getCompressedSize
in class ZipEntry
public long getExternalAttributes()
public ZipExtraField[] getExtraFields()
public int getInternalAttributes()
public byte[] getLocalFileDataExtra()
public void addExtraField(ZipExtraField extraField)
extraField
- The feature to be added to the ExtraField attributepublic Object clone()
clone
in class ZipEntry
public void removeExtraField(ZipShort type)
type
- Description of Parameterprotected void setExtra()
java.util.zip.ZipOutputStream
seems to access the extra data directly,
so overriding getExtra doesn't help - we need to modify super's data
directly.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |