org.apache.commons.compress.archivers.zip
public class ZipEntry extends ZipEntry
Version: $Revision: 155439 $
Field Summary | |
---|---|
static Object | c_lockReflection
Helper for JDK 1.1
|
static Method | c_setCompressedSizeMethod
Helper for JDK 1.1
|
static boolean | c_triedToGetMethod
Helper for JDK 1.1
|
Long | m_compressedSize
Helper for JDK 1.1 <-> 1.2 incompatibility.
|
long | m_externalAttributes |
ArrayList | m_extraFields |
int | m_internalAttributes |
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.
|
static void | checkSCS()
Try to get a handle to the setCompressedSize method.
|
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.
|
static boolean | haveSetCompressedSize()
Are we running JDK 1.2 or higher?
|
static void | performSetCompressedSize(ZipEntry entry, long size)
Invoke setCompressedSize via reflection.
|
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.
|
void | setExtra(byte[] extra)
Throws an Exception if extra data cannot be parsed into extra fields.
|
protected void | setExtra()
Unfortunately java.util.zip.ZipOutputStream
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 | setExtraFields(ZipExtraField[] fields)
Replaces all currently attached extra fields with the new array.
|
void | setInternalAttributes(int value)
Sets the internal file attributes.
|
Since: 1.2
Since: 1.2
Since: 1.2
Since: 1.2
Parameters: name the name of entry
Since: 1.1
Parameters: entry the JDK ZipEntry to adapt
Throws: ZipException if can not create entry
Since: 1.1
Parameters: entry the entry to adapt
Throws: ZipException if can not create entry
Since: 1.1
Parameters: extraField The feature to be added to the ExtraField attribute
Since: 1.1
Since: 1.2
Returns: Description of the Returned Value
Since: 1.1
Returns: The CentralDirectoryExtra value
Since: 1.1
Returns: The CompressedSize value
Since: 1.2
Returns: The ExternalAttributes value
Since: 1.1
Returns: The ExtraFields value
Since: 1.1
Returns: The InternalAttributes value
Since: 1.1
Returns: The LocalFileDataExtra value
Since: 1.1
Returns: Description of the Returned Value
Since: 1.2
Parameters: entry Description of Parameter size Description of Parameter
Since: 1.2
Parameters: type Description of Parameter
Since: 1.1
This either stores the size for later usage or invokes setCompressedSize via reflection.
Parameters: size The new ComprSize value
Since: 1.2
Parameters: externalAttributes The new ExternalAttributes value
Since: 1.1
Parameters: extra The new Extra value
Throws: RuntimeException if fail to set extra data
Since: 1.1
java.util.zip.ZipOutputStream
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.
Since: 1.1
Parameters: fields The new ExtraFields value
Since: 1.1
Parameters: value The new InternalAttributes value
Since: 1.1