public abstract class ZipEntry extends AbstractArchiveEntry<ZipEntry,ZipDirectoryEntry>
Zip entries contains the following information:
Property | Description |
---|---|
Version used to create | The equivalent version of the PK-Zip software that was used to create the entry. |
Version needed to extract | The equivalent version of the PK-Zip software that is needed to extract the entry. |
Last modification time | The last modification time for the file system entity (file, directory) that was used to create the Zip entry. |
ZipGeneralPurposeBitFlags |
Various information. Some of it is compression method-specific. |
Comment | A text comment for the Zip entry. |
External file attributes | Attributes for the entry. There are several different ways of
interpreting these attributes. Some of the ways are included in this package
as ZipExternalFileAttributes implementations. |
Extra fields | Zero or more extra fields (ZipEntryExtraField :s) that contain
custom metadata for the entry. An extra field for an entry always has two
instances – the local header instance and the central directory
instance. |
Zip entry objects are always immutable.
ZipFile
Modifier | Constructor and Description |
---|---|
protected |
ZipEntry(ZipEntryCollaborator collaborator,
org.entityfs.el.AbsoluteLocation loc)
Create a new Zip entry.
|
protected |
ZipEntry(ZipEntryCollaborator collaborator,
ZipEntryCentralFileHeaderData zecd,
ZipEntryLocalFileHeaderData zeld)
Create a new Zip entry.
|
Modifier and Type | Method and Description |
---|---|
String |
getComment()
Get the Zip entry's comment.
|
UnsignedShort |
getDiskNumberStart()
Get the number of the disk where this Zip entry begins.
|
ZipExternalFileAttributes |
getExternalFileAttributes()
Get the external file attributes value.
|
<T> T |
getExtraField(Class<T> type,
boolean localHeader)
Get the first extra field found that matches the description.
|
Collection<ZipEntryExtraField> |
getExtraFields()
Get a read only collection containing the Zip entry's extra fields.
|
ZipGeneralPurposeBitFlags |
getGeneralPurposeBitFlags()
Get the Zip entry's general purpose bit flags.
|
Date |
getLastModified()
Get the instant in time when the file or directory entity that was used
to create this Zip entry was last modified.
|
UnsignedByte |
getVersionNeededToExtract()
Get the earliest PK-Zip version that can extract this Zip entry.
|
UnsignedByte |
getVersionUsedToCreate()
Get the PK-Zip version (or equivalent) that was used to create this Zip
entry.
|
boolean |
isEncrypted()
Is the Zip entry encrypted?
|
boolean |
isStrongEncryption()
Is the Zip entry encrypted with strong encryption?
|
getCollaborator, getLocation, getName, getParent, getReadLock, isReadLockedByCurrentThread, lockForReading
protected ZipEntry(ZipEntryCollaborator collaborator, org.entityfs.el.AbsoluteLocation loc)
The Zip entry is assigned default values for all of its properties:
Property | Value |
---|---|
External file attributes | MsDosExternalFileAttributes.DEFAULT_DIRECTORY_ATTRIBUTES |
Version used to create | 10 (meaning 1.0) |
Version needed to extract | 10 (meaning 1.0) |
General purpose bit flags | empty |
Last modification time | The current time |
Extra fields | none |
Comment | Empty string |
collaborator
- The parent Zip archive's entry collaborator.loc
- The location of the entry in the Zip file.protected ZipEntry(ZipEntryCollaborator collaborator, ZipEntryCentralFileHeaderData zecd, ZipEntryLocalFileHeaderData zeld)
collaborator
- The parent Zip archive's entry collaborator.zecd
- Data parsed from the entry's central directory record.zeld
- Data parsed from the entry's local header.public UnsignedByte getVersionUsedToCreate()
public UnsignedByte getVersionNeededToExtract()
public ZipGeneralPurposeBitFlags getGeneralPurposeBitFlags()
isEncrypted()
, ZipFileEntry.isCompressedPatchData()
and
isStrongEncryption()
.public boolean isEncrypted()
true
if the Zip entry is encrypted.isStrongEncryption()
public boolean isStrongEncryption()
true
if the Zip entry is encrypted with strong
encryption.isEncrypted()
public Date getLastModified()
The ExtendedTimestampExtraField
, if present, has
the last modified time in the UTC time zone.
public UnsignedShort getDiskNumberStart()
public ZipExternalFileAttributes getExternalFileAttributes()
public Collection<ZipEntryExtraField> getExtraFields()
public <T> T getExtraField(Class<T> type, boolean localHeader)
T
- The type of the extra field.type
- The class of the extra field, or a superclass.localHeader
- Should the extra field be from the local or the
central header?null
if no extra field matches it.public String getComment()