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. Versions prior to Apache Commons Compress 1.1 would have thrown an exception if any attempt was made to read or write extra data not conforming to the recommendation.
| Modifier and Type | Class and Description |
|---|---|
| public static enum | ZipArchiveEntry.CommentSource
Indicates how the comment of this entry has been determined. |
| public static enum | ZipArchiveEntry.ExtraFieldParsingMode
How to try to parse the extra fields. |
| public static enum | ZipArchiveEntry.NameSource
Indicates how the name of this entry has been determined. |
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private ZipArchiveEntry. | |
| public static final int | |
| private long | |
| private long | |
| pack-priv static final ZipArchiveEntry[] | |
| pack-priv static LinkedList | |
| private long | |
| private final Function | |
| private ZipExtraField[] | |
| private GeneralPurposeBit | |
| private int | |
| private boolean | |
| private boolean | |
| private long | |
| private int | method
Hides java. java. base class only supports the compression methods STORED and DEFLATED.
|
| private String | |
| private ZipArchiveEntry. | |
| private int | |
| public static final int | |
| public static final int | |
| private 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 and even in Java 7+ if the implementation in java.util.zip doesn't support Zip64 itself (it is an optional feature).
|
| private long | |
| private UnparseableExtraFieldData | |
| private int | |
| private int | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| protected | |
| public | ZipArchiveEntry(final File
file to create the entry from inputFile, final String name of the entry entryName)Creates a new ZIP entry taking some information from the given file and using the provided name. |
| private | ZipArchiveEntry(final Function<ZipShort, ZipExtraField>
custom lookup factory for extra fields or null extraFieldFactory, final File file to create the entry from inputFile, final String name of the entry entryName)Creates a new ZIP entry taking some information from the given file and using the provided name. |
| private | ZipArchiveEntry(final Function<ZipShort, ZipExtraField>
the extra field lookup factory. extraFieldFactory, final ZipEntry the entry to get fields from entry)Creates a new ZIP entry with fields taken from the specified ZIP entry. |
| private | ZipArchiveEntry(final Function<ZipShort, ZipExtraField>
custom lookup factory for extra fields or null extraFieldFactory, final Path path to create the entry from. inputPath, final String name of the entry. entryName, final LinkOption... options indicating how symbolic links are handled. options)Creates a new ZIP entry taking some information from the given path and using the provided name. |
| private | ZipArchiveEntry(final Function<ZipShort, ZipExtraField>
custom lookup factory for extra fields or null extraFieldFactory, final String the name of the entry name)Creates a new ZIP entry with the specified name. |
| public | ZipArchiveEntry(final ZipEntry
the entry to get fields from entry)Creates a new ZIP entry with fields taken from the specified ZIP entry. |
| public | ZipArchiveEntry(final Path
path to create the entry from. inputPath, final String name of the entry. entryName, final LinkOption... options indicating how symbolic links are handled. options)Creates a new ZIP entry taking some information from the given path and using the provided name. |
| public | ZipArchiveEntry(final String
the name of the entry name)Creates a new ZIP entry with the specified name. |
| public | ZipArchiveEntry(final ZipArchiveEntry
the entry to get fields from entry)Creates a new ZIP entry with fields taken from the specified ZIP entry. |
| 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. |
| private void | addInfoZipExtendedTimestamp(final FileTime lastModifiedTime, final FileTime lastAccessTime, final FileTime creationTime)
|
| private void | addNTFSTimestamp(final FileTime lastModifiedTime, final FileTime lastAccessTime, final FileTime creationTime)
|
| private static boolean | canConvertToInfoZipExtendedTimestamp(final FileTime lastModifiedTime, final FileTime lastAccessTime, final FileTime creationTime)
|
| public Object | Returns: a cloned copy of this ZipArchiveEntryOverrides java. |
| private ZipExtraField[] | |
| public boolean | equals(final Object
the reference object with which to compare. obj)Overrides java. |
| private ZipExtraField | |
| private ZipExtraField | |
| protected int | |
| private ZipExtraField[] | |
| private ZipExtraField[] | Returns: An array of all extra fields. Not necessarily a copy of internal data structures, hence private methodGets all extra fields, including unparseable ones. |
| public byte[] | Returns: the central directory extra dataRetrieves the extra data for the central directory. |
| public ZipArchiveEntry. | |
| public long | getDataOffset()
Implements org. |
| public long | Returns: the number of the split segment this entry starts at.The number of the split segment this entry starts at. |
| public long | |
| public ZipExtraField | Returns: null if no such field exists.the header id type)Gets an extra field by its header id. |
| public ZipExtraField[] | Returns: an array of the extra fieldsGets 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.Gets extra fields. |
| public ZipExtraField[] | Returns: an array of the extra fieldscontrols parsing of extra fields. parsingBehavior)Gets extra fields. |
| public GeneralPurposeBit | |
| public int | |
| public Date | getLastModifiedDate()
Implements org. java. with a Date as the entry's last modified date.
|
| public byte[] | Returns: the extra data for local fileGets the extra data for the local file data. |
| public long | |
| private ZipExtraField[] | |
| public int | Returns: compression methodOverrides java. |
| public String | Returns: the entry nameOverrides java. Implements org. |
| public ZipArchiveEntry. | |
| 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 int | |
| public byte[] | Returns: the raw name bytesReturns 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. Implements org. |
| public long | Returns: The last modification time of the entry in milliseconds since the epoch, or -1 if not specifiedOverrides java. |
| public int | |
| public UnparseableExtraFieldData | Returns: null if no such field exists.Gets up extra field data that couldn't be parsed correctly. |
| private ZipExtraField[] | |
| public int | |
| public int | Returns: "version required to expand" fieldGets the "version required to expand" field. |
| public int | Returns: a hash code.Overrides java. |
| private void | |
| private void | |
| private void | |
| public boolean | Returns: true if the entry is a directoryOverrides java. Implements org. |
| private static boolean | |
| public boolean | isStreamContiguous()
Implements org. |
| public boolean | Returns: true if the entry represents a unix symlink, false otherwise.Returns true if this entry represents a unix symlink, in which case the entry's content contains the target path for the symlink. |
| 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. |
| private ZipExtraField[] | parseExtraFields(final byte[] data, final boolean local, final ExtraFieldParsingBehavior parsingBehavior)
|
| public void | |
| public void | |
| private boolean | |
| public void | |
| private void | |
| public void | setCentralDirectoryExtra(final byte[]
an array of bytes to be parsed into extra fields b)Sets the central directory part of extra fields. |
| public void | setCommentSource(final ZipArchiveEntry.
source of the comment field value commentSourceSets the source of the comment field value. |
| public ZipEntry | setCreationTime(final FileTime
The creation time of the entry time)Overrides java. |
| protected void | |
| public void | setDiskNumberStart(final long
the number of the split segment this entry starts at. diskNumberStart)The number of the split segment this entry starts at. |
| public void | |
| protected void | setExtra()
Unfortunately |
| public void | setExtra(final byte[]
an array of bytes to be parsed into extra fields extra)Overrides java. UnparseableExtraFieldData instance.
|
| public void | setExtraFields(final ZipExtraField[]
an array of extra fields fields)Replaces all currently attached extra fields with the new array. |
| private void | |
| public void | setGeneralPurposeBit(final GeneralPurposeBit
the general purpose bit generalPurposeBit)Sets the "general purpose bit" field. |
| public void | |
| public ZipEntry | setLastAccessTime(final FileTime
The last access time of the entry fileTime)Overrides java. |
| public ZipEntry | setLastModifiedTime(final FileTime
The last modification time of the entry fileTime)Overrides java. |
| protected void | |
| public void | setMethod(final int
compression method method)Overrides java. |
| protected void | |
| protected void | |
| public void | setNameSource(final ZipArchiveEntry.
source of the name field value nameSourceSets the source of the name field value. |
| protected void | |
| public void | |
| public void | setSize(final long
the uncompressed size in bytes size)Overrides java. |
| protected void | |
| public void | |
| public void | setTime(final long
The last modification time of the entry in milliseconds since the epoch. timeEpochMillis)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. |
| public void | |
| public void | setVersionRequired(final int
"version required to expand" field versionRequired)Sets the "version required to expand" field. |
| private static String | |
| private static String | |
| private static String | |
| private void | |
| private void | updateTimeFromExtendedTimestampField()
Workaround for the fact that, as of Java 17, |
| private void | updateTimeFromNtfsField()
Workaround for the fact that, as of Java 17, |