|
|||||||||||
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.zip.ZipEntry
Extension that adds better handling of extra fields and provides access to the internal and external file attributes.
Field Summary |
Fields inherited from class java.util.zip.ZipEntry |
CENATT, CENATX, CENCOM, CENCRC, CENDSK, CENEXT, CENFLG, CENHDR, CENHOW, CENLEN, CENNAM, CENOFF, CENSIG, CENSIZ, CENTIM, CENVEM, CENVER, DEFLATED, ENDCOM, ENDHDR, ENDOFF, ENDSIG, ENDSIZ, ENDSUB, ENDTOT, EXTCRC, EXTHDR, EXTLEN, EXTSIG, EXTSIZ, LOCCRC, LOCEXT, LOCFLG, LOCHDR, LOCHOW, LOCLEN, LOCNAM, LOCSIG, LOCSIZ, LOCTIM, LOCVER, STORED |
Constructor Summary | |
ZipEntry(java.lang.String name)
Creates a new zip entry with the specified name. |
|
ZipEntry(java.util.zip.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. |
java.lang.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 |
Constructor Detail |
public ZipEntry(java.lang.String name)
name
- the name of entrypublic ZipEntry(java.util.zip.ZipEntry entry) throws java.util.zip.ZipException
entry
- the JDK ZipEntry to adapt
java.util.zip.ZipException
- if can not create entrypublic ZipEntry(ZipEntry entry) throws java.util.zip.ZipException
entry
- the entry to adapt
java.util.zip.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 java.lang.RuntimeException
extra
- The new Extra value
java.lang.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()
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 java.lang.Object clone()
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 |