The extra data is expected to follow the recommendation of APPNOTE.txt:
Any extra data that cannot be parsed by the rules above will be consumed as "unparseable" extra data and treated differently by the methods of this class. Older versions would have thrown an exception if any attempt was made to read or write extra data not conforming to the recommendation.
| Modifier and Type | Field and Description |
|---|---|
| public static final int | |
| private static final byte[] | |
| private long | |
| private ZipExtraField[] | |
| private GeneralPurposeBit | |
| private int | |
| private int | method
Hides java. java. base class only supports
the compression methods STORED and DEFLATED.
|
| private String | |
| private static final ZipExtraField[] | |
| private int | |
| public static final int | |
| public static final int | |
| private byte[] | |
| private static final int | |
| private static final int | |
| private long | size
Hides java. java. method in the base
class throws an IllegalArgumentException if the size is bigger
than 2GB for Java versions < 7.
|
| private UnparseableExtraFieldData |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | |
| protected | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addAsFirstExtraField(final ZipExtraField
an extra field ze)Adds an extra field - replacing an already present extra field of the same type. |
| public void | addExtraField(final ZipExtraField
an extra field ze)Adds an extra field - replacing an already present extra field of the same type. |
| public Object | Returns: a cloned copy of this ZipEntryOverrides java. |
| private ZipExtraField[] | |
| private ZipExtraField[] | |
| public boolean | equals(final Object
the reference object with which to compare. obj)Overrides java. |
| private ZipExtraField[] | |
| private ZipExtraField[] | Returns: An array of all extra fields. Not necessarily a copy of internal data structures, hence private methodGet all extra fields, including unparseable ones. |
| public byte[] | Returns: the central directory extra dataRetrieves the extra data for the central directory. |
| public long | |
| public ZipExtraField | Returns: null if no such field exists.ZipShort type)Looks up an extra field by its header id. |
| public ZipExtraField[] | Returns: an array of the extra fieldsRetrieves all extra fields that have been parsed successfully. |
| public ZipExtraField[] | Returns: an array of the extra fieldswhether to also return unparseable
extra fields as includeUnparseable)UnparseableExtraFieldData if such data
exists.Retrieves extra fields. |
| public GeneralPurposeBit | |
| public int | |
| public Date | |
| public byte[] | Returns: the extra data for local fileRetrieves the extra data for the local file data. |
| private ZipExtraField[] | |
| public int | Returns: compression methodOverrides java. |
| public String | Returns: the entry nameOverrides java. |
| private ZipExtraField[] | |
| private ZipExtraField[] | |
| public int | Returns: PLATFORM_FAT unlesssetUnixMode
has been called, in which case PLATFORM_UNIX will be returned.Platform specification to put into the "version made by" part of the central file header. |
| public byte[] | Returns: byte[]Returns the raw bytes that made up the name before it has been converted using the configured or guessed encoding. |
| public long | Returns: the entry sizeOverrides java. |
| public int | |
| public UnparseableExtraFieldData | Returns: null if no such field exists.Looks up extra field data that couldn't be parsed correctly. |
| private ZipExtraField[] | |
| public int | Returns: a hashcode.Overrides java. |
| public boolean | Returns: true if the entry is a directoryOverrides java. |
| private void | mergeExtraFields(final ZipExtraField[]
the extra fields to merge f, final boolean whether the new fields originate from local data local)If there are no extra fields, use the given fields as new extra data - otherwise merge the fields assuming the existing fields and the new fields stem from different locations inside the archive. |
| public void | |
| public void | |
| public void | |
| public void | setComprSize(final long
the size to use size)
Deprecated
since 1.7.
Use
Make this class work in JDK 1.1 like a 1.2 class.
setCompressedSize(long) directly.
|
| public void | |
| public void | setExtra(final byte[]
an array of bytes to be parsed into extra fields extra)Overrides java. UnparseableExtraFieldData
instance.
|
| protected void | setExtra()
Unfortunately |
| public void | setExtraFields(final ZipExtraField[]
an array of extra fields fields)Replaces all currently attached extra fields with the new array. |
| public void | |
| public void | |
| public void | setMethod(final int
compression method method)Overrides java. |
| protected void | |
| protected void | |
| protected void | |
| public void | setSize(final long
the uncompressed size in bytes size)Overrides java. |
| public void | setUnixMode(final int
an mode)int valueSets Unix permissions in a way that is understood by Info-Zip's unzip command. |
| CRC_UNKNOWN | back to summary |
|---|---|
| public static final int CRC_UNKNOWN | |
| EMPTY | back to summary |
|---|---|
| private static final byte[] EMPTY | |
| externalAttributes | back to summary |
|---|---|
| private long externalAttributes | |
| extraFields | back to summary |
|---|---|
| private ZipExtraField[] extraFields | |
| gpb | back to summary |
|---|---|
| private GeneralPurposeBit gpb | |
| internalAttributes | back to summary |
|---|---|
| private int internalAttributes | |
| method | back to summary |
|---|---|
| private int method Hides java. The The default value -1 means that the method has not been specified. | |
| name | back to summary |
|---|---|
| private String name Hides java. | |
| noExtraFields | back to summary |
|---|---|
| private static final ZipExtraField[] noExtraFields | |
| platform | back to summary |
|---|---|
| private int platform | |
| PLATFORM_FAT | back to summary |
|---|---|
| public static final int PLATFORM_FAT | |
| PLATFORM_UNIX | back to summary |
|---|---|
| public static final int PLATFORM_UNIX | |
| rawName | back to summary |
|---|---|
| private byte[] rawName | |
| SHORT_MASK | back to summary |
|---|---|
| private static final int SHORT_MASK | |
| SHORT_SHIFT | back to summary |
|---|---|
| private static final int SHORT_SHIFT | |
| size | back to summary |
|---|---|
| private long size Hides java. The | |
| unparseableExtra | back to summary |
|---|---|
| private UnparseableExtraFieldData unparseableExtra | |
| ZipEntry | back to summary |
|---|---|
| public ZipEntry(final String name) Creates a new zip entry with the specified name. Assumes the entry represents a directory if and only if the name ends with a forward slash "/".
| |
| ZipEntry | back to summary |
|---|---|
| public ZipEntry(final ZipEntry entry) throws ZipException Creates a new zip entry with fields taken from the specified zip entry. Assumes the entry represents a directory if and only if the name ends with a forward slash "/".
| |
| ZipEntry | back to summary |
|---|---|
| public ZipEntry(final ZipEntry entry) throws ZipException Creates a new zip entry with fields taken from the specified zip entry. Assumes the entry represents a directory if and only if the name ends with a forward slash "/".
| |
| ZipEntry | back to summary |
|---|---|
protected ZipEntry()
| |
| ZipEntry | back to summary |
|---|---|
| public ZipEntry(final File inputFile, final String entryName) Creates a new zip entry taking some information from the given file and using the provided name. The name will be adjusted to end with a forward slash "/" if the file is a directory. If the file is not a directory a potential trailing forward slash will be stripped from the entry name. | |
| addAsFirstExtraField | back to summary |
|---|---|
| public void addAsFirstExtraField(final ZipExtraField ze) Adds an extra field - replacing an already present extra field of the same type. The new extra field will be the first one.
| |
| addExtraField | back to summary |
|---|---|
| public void addExtraField(final ZipExtraField ze) Adds an extra field - replacing an already present extra field of the same type. If no extra field of the same type exists, the field will be added as last field.
| |
| clone | back to summary |
|---|---|
| public Object clone() Overrides java. Override clone. | |
| copyOf | back to summary |
|---|---|
| private ZipExtraField[] copyOf(ZipExtraField[] src) | |
| copyOf | back to summary |
|---|---|
| private ZipExtraField[] copyOf(ZipExtraField[] src, int length) | |
| equals | back to summary |
|---|---|
| public boolean equals(final Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getAllExtraFields | back to summary |
|---|---|
| private ZipExtraField[] getAllExtraFields() | |
| getAllExtraFieldsNoCopy | back to summary |
|---|---|
| private ZipExtraField[] getAllExtraFieldsNoCopy() Get all extra fields, including unparseable ones.
| |
| getCentralDirectoryExtra | back to summary |
|---|---|
| public byte[] getCentralDirectoryExtra() Retrieves the extra data for the central directory.
| |
| getExternalAttributes | back to summary |
|---|---|
| public long getExternalAttributes() Retrieves the external file attributes.
| |
| getExtraField | back to summary |
|---|---|
| public ZipExtraField getExtraField(final ZipShort type) Looks up an extra field by its header id.
| |
| getExtraFields | back to summary |
|---|---|
| public ZipExtraField[] getExtraFields() Retrieves all extra fields that have been parsed successfully.
| |
| getExtraFields | back to summary |
|---|---|
| public ZipExtraField[] getExtraFields(final boolean includeUnparseable) Retrieves extra fields.
| |
| getGeneralPurposeBit | back to summary |
|---|---|
| public GeneralPurposeBit getGeneralPurposeBit() The "general purpose bit" field.
| |
| getInternalAttributes | back to summary |
|---|---|
| public int getInternalAttributes() Retrieves the internal file attributes.
| |
| getLastModifiedDate | back to summary |
|---|---|
| public Date getLastModifiedDate() Get last modified time as | |
| getLocalFileDataExtra | back to summary |
|---|---|
| public byte[] getLocalFileDataExtra() Retrieves the extra data for the local file data.
| |
| getMergedFields | back to summary |
|---|---|
| private ZipExtraField[] getMergedFields() | |
| getMethod | back to summary |
|---|---|
| public int getMethod() Overrides java. Returns the compression method of this entry, or -1 if the compression method has not been specified.
| |
| getName | back to summary |
|---|---|
| public String getName() Overrides java. Get the name of the entry. | |
| getParseableExtraFields | back to summary |
|---|---|
| private ZipExtraField[] getParseableExtraFields() | |
| getParseableExtraFieldsNoCopy | back to summary |
|---|---|
| private ZipExtraField[] getParseableExtraFieldsNoCopy() | |
| getPlatform | back to summary |
|---|---|
| public int getPlatform() Platform specification to put into the "version made by" part of the central file header.
| |
| getRawName | back to summary |
|---|---|
| public byte[] getRawName() Returns the raw bytes that made up the name before it has been converted using the configured or guessed encoding. This method will return null if this instance has not been read from an archive.
| |
| getSize | back to summary |
|---|---|
| public long getSize() Overrides java. Gets the uncompressed size of the entry data.
| |
| getUnixMode | back to summary |
|---|---|
| public int getUnixMode() Unix permission.
| |
| getUnparseableExtraFieldData | back to summary |
|---|---|
| public UnparseableExtraFieldData getUnparseableExtraFieldData() Looks up extra field data that couldn't be parsed correctly.
| |
| getUnparseableOnly | back to summary |
|---|---|
| private ZipExtraField[] getUnparseableOnly() | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Get the hashCode of the entry. This uses the name as the hashcode.
| |
| isDirectory | back to summary |
|---|---|
| public boolean isDirectory() Overrides java. Is this entry a directory?
| |
| mergeExtraFields | back to summary |
|---|---|
| private void mergeExtraFields(final ZipExtraField[] f, final boolean local) throws ZipException If there are no extra fields, use the given fields as new extra data - otherwise merge the fields assuming the existing fields and the new fields stem from different locations inside the archive.
| |
| removeExtraField | back to summary |
|---|---|
| public void removeExtraField(final ZipShort type) Remove an extra field.
| |
| removeUnparseableExtraFieldData | back to summary |
|---|---|
| public void removeUnparseableExtraFieldData() Removes unparseable extra field data. | |
| setCentralDirectoryExtra | back to summary |
|---|---|
| public void setCentralDirectoryExtra(final byte[] b) Sets the central directory part of extra fields.
| |
| setComprSize | back to summary |
|---|---|
| public void setComprSize(final long size)
Deprecated since 1.7.
Use Make this class work in JDK 1.1 like a 1.2 class. This either stores the size for later usage or invokes setCompressedSize via reflection.
| |
| setExternalAttributes | back to summary |
|---|---|
| public void setExternalAttributes(final long value) Sets the external file attributes.
| |
| setExtra | back to summary |
|---|---|
| public void setExtra(final byte[] extra) throws RuntimeException Overrides java. Parses the given bytes as extra field data and consumes any
unparseable data as an
| |
| setExtra | back to summary |
|---|---|
| protected void setExtra() Unfortunately
| |
| setExtraFields | back to summary |
|---|---|
| public void setExtraFields(final ZipExtraField[] fields) Replaces all currently attached extra fields with the new array.
| |
| setGeneralPurposeBit | back to summary |
|---|---|
| public void setGeneralPurposeBit(final GeneralPurposeBit b) The "general purpose bit" field.
| |
| setInternalAttributes | back to summary |
|---|---|
| public void setInternalAttributes(final int value) Sets the internal file attributes.
| |
| setMethod | back to summary |
|---|---|
| public void setMethod(final int method) Overrides java. Sets the compression method of this entry.
| |
| setName | back to summary |
|---|---|
| protected void setName(String name) Set the name of the entry.
| |
| setName | back to summary |
|---|---|
| protected void setName(final String name, final byte[] rawName) Sets the name using the raw bytes and the string created from it by guessing or using the configured encoding.
| |
| setPlatform | back to summary |
|---|---|
| protected void setPlatform(final int platform) Set the platform (UNIX or FAT).
| |
| setSize | back to summary |
|---|---|
| public void setSize(final long size) Overrides java. Sets the uncompressed size of the entry data.
| |
| setUnixMode | back to summary |
|---|---|
| public void setUnixMode(final int mode) Sets Unix permissions in a way that is understood by Info-Zip's unzip command.
| |