Class JarEntry
java.lang.Object
java.util.zip.ZipEntry
java.util.jar.JarEntry
- All Implemented Interfaces:
- Cloneable
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intCentral directory (CEN) header internal file attributes field offset.static final intCentral directory (CEN) header external file attributes field offset.static final intCentral directory (CEN) header comment length field offset.static final intCentral directory (CEN) header uncompressed file crc-32 value field offset.static final intCentral directory (CEN) header disk number start field offset.static final intCentral directory (CEN) header extra field length field offset.static final intCentral directory (CEN) header encrypt, decrypt flags field offset.static final intCentral directory (CEN) header size in bytes (including signature).static final intCentral directory (CEN) header compression method field offset.static final intCentral directory (CEN) header uncompressed size field offset.static final intCentral directory (CEN) header filename length field offset.static final intCentral directory (CEN) header LOC header offset field offset.static final longCentral directory (CEN) header signature.static final intCentral directory (CEN) header compressed size field offset.static final intCentral directory (CEN) header modification time field offset.static final intCentral directory (CEN) header version made by field offset.static final intCentral directory (CEN) header version needed to extract field offset.static final intEnd of central directory (END) header ZIP file comment length field offset.static final intEnd of central directory (END) header size in bytes (including signature).static final intEnd of central directory (END) header offset for the first CEN header field offset.static final longEnd of central directory (END) header signature.static final intEnd of central directory (END) header central directory size in bytes field offset.static final intEnd of central directory (END) header number of entries on this disk field offset.static final intEnd of central directory (END) header total number of entries field offset.static final intExtra local (EXT) header uncompressed file crc-32 value field offset.static final intExtra local (EXT) header size in bytes (including signature).static final intExtra local (EXT) header uncompressed size field offset.static final longExtra local (EXT) header signature.static final intExtra local (EXT) header compressed size field offset.static final intLocal file (LOC) header uncompressed file crc-32 value field offset.static final intLocal file (LOC) header extra field length field offset.static final intLocal file (LOC) header general purpose bit flag field offset.static final intLocal file (LOC) header size in bytes (including signature).static final intLocal file (LOC) header compression method field offset.static final intLocal file (LOC) header uncompressed size field offset.static final intLocal file (LOC) header filename length field offset.static final longLocal file (LOC) header signature.static final intLocal file (LOC) header compressed size field offset.static final intLocal file (LOC) header modification time field offset.static final intLocal file (LOC) header version needed to extract field offset.
- 
Constructor SummaryConstructorsConstructorDescriptionCreates a newJarEntryfor the specified JAR file entry name.Creates a newJarEntrywith fields taken from the specifiedJarEntryobject.Creates a newJarEntrywith fields taken from the specifiedZipEntryobject.
- 
Method SummaryModifier and TypeMethodDescriptionReturns theManifestAttributesfor this entry, ornullif none.Returns theCertificateobjects for this entry, ornullif none.Returns theCodeSignerobjects for this entry, ornullif none.Returns the real name of thisJarEntry.Methods declared in class ZipEntryclone, getComment, getCompressedSize, getCrc, getCreationTime, getExtra, getLastAccessTime, getLastModifiedTime, getMethod, getName, getSize, getTime, getTimeLocal, hashCode, isDirectory, setComment, setCompressedSize, setCrc, setCreationTime, setExtra, setLastAccessTime, setLastModifiedTime, setMethod, setSize, setTime, setTimeLocal, toString
- 
Field Details- 
LOCSIGstatic final long LOCSIGLocal file (LOC) header signature.- See Also:
 
- 
EXTSIGstatic final long EXTSIGExtra local (EXT) header signature.- See Also:
 
- 
CENSIGstatic final long CENSIGCentral directory (CEN) header signature.- See Also:
 
- 
ENDSIGstatic final long ENDSIGEnd of central directory (END) header signature.- See Also:
 
- 
LOCHDRstatic final int LOCHDRLocal file (LOC) header size in bytes (including signature).- See Also:
 
- 
EXTHDRstatic final int EXTHDRExtra local (EXT) header size in bytes (including signature).- See Also:
 
- 
CENHDRstatic final int CENHDRCentral directory (CEN) header size in bytes (including signature).- See Also:
 
- 
ENDHDRstatic final int ENDHDREnd of central directory (END) header size in bytes (including signature).- See Also:
 
- 
LOCVERstatic final int LOCVERLocal file (LOC) header version needed to extract field offset.- See Also:
 
- 
LOCFLGstatic final int LOCFLGLocal file (LOC) header general purpose bit flag field offset.- See Also:
 
- 
LOCHOWstatic final int LOCHOWLocal file (LOC) header compression method field offset.- See Also:
 
- 
LOCTIMstatic final int LOCTIMLocal file (LOC) header modification time field offset.- See Also:
 
- 
LOCCRCstatic final int LOCCRCLocal file (LOC) header uncompressed file crc-32 value field offset.- See Also:
 
- 
LOCSIZstatic final int LOCSIZLocal file (LOC) header compressed size field offset.- See Also:
 
- 
LOCLENstatic final int LOCLENLocal file (LOC) header uncompressed size field offset.- See Also:
 
- 
LOCNAMstatic final int LOCNAMLocal file (LOC) header filename length field offset.- See Also:
 
- 
LOCEXTstatic final int LOCEXTLocal file (LOC) header extra field length field offset.- See Also:
 
- 
EXTCRCstatic final int EXTCRCExtra local (EXT) header uncompressed file crc-32 value field offset.- See Also:
 
- 
EXTSIZstatic final int EXTSIZExtra local (EXT) header compressed size field offset.- See Also:
 
- 
EXTLENstatic final int EXTLENExtra local (EXT) header uncompressed size field offset.- See Also:
 
- 
CENVEMstatic final int CENVEMCentral directory (CEN) header version made by field offset.- See Also:
 
- 
CENVERstatic final int CENVERCentral directory (CEN) header version needed to extract field offset.- See Also:
 
- 
CENFLGstatic final int CENFLGCentral directory (CEN) header encrypt, decrypt flags field offset.- See Also:
 
- 
CENHOWstatic final int CENHOWCentral directory (CEN) header compression method field offset.- See Also:
 
- 
CENTIMstatic final int CENTIMCentral directory (CEN) header modification time field offset.- See Also:
 
- 
CENCRCstatic final int CENCRCCentral directory (CEN) header uncompressed file crc-32 value field offset.- See Also:
 
- 
CENSIZstatic final int CENSIZCentral directory (CEN) header compressed size field offset.- See Also:
 
- 
CENLENstatic final int CENLENCentral directory (CEN) header uncompressed size field offset.- See Also:
 
- 
CENNAMstatic final int CENNAMCentral directory (CEN) header filename length field offset.- See Also:
 
- 
CENEXTstatic final int CENEXTCentral directory (CEN) header extra field length field offset.- See Also:
 
- 
CENCOMstatic final int CENCOMCentral directory (CEN) header comment length field offset.- See Also:
 
- 
CENDSKstatic final int CENDSKCentral directory (CEN) header disk number start field offset.- See Also:
 
- 
CENATTstatic final int CENATTCentral directory (CEN) header internal file attributes field offset.- See Also:
 
- 
CENATXstatic final int CENATXCentral directory (CEN) header external file attributes field offset.- See Also:
 
- 
CENOFFstatic final int CENOFFCentral directory (CEN) header LOC header offset field offset.- See Also:
 
- 
ENDSUBstatic final int ENDSUBEnd of central directory (END) header number of entries on this disk field offset.- See Also:
 
- 
ENDTOTstatic final int ENDTOTEnd of central directory (END) header total number of entries field offset.- See Also:
 
- 
ENDSIZstatic final int ENDSIZEnd of central directory (END) header central directory size in bytes field offset.- See Also:
 
- 
ENDOFFstatic final int ENDOFFEnd of central directory (END) header offset for the first CEN header field offset.- See Also:
 
- 
ENDCOMstatic final int ENDCOMEnd of central directory (END) header ZIP file comment length field offset.- See Also:
 
 
- 
- 
Constructor Details- 
JarEntryCreates a newJarEntryfor the specified JAR file entry name.- Parameters:
- name- the JAR file entry name
- Throws:
- NullPointerException- if the entry name is- null
- IllegalArgumentException- if the entry name is longer than 0xFFFF bytes.
 
- 
JarEntryCreates a newJarEntrywith fields taken from the specifiedZipEntryobject.- Parameters:
- ze- the- ZipEntryobject to create the- JarEntryfrom
- Throws:
- NullPointerException- if- zeis null
 
- 
JarEntryCreates a newJarEntrywith fields taken from the specifiedJarEntryobject.- Parameters:
- je- the- JarEntryto copy
- Throws:
- NullPointerException- if- jeis null
 
 
- 
- 
Method Details- 
getAttributesReturns theManifestAttributesfor this entry, ornullif none.- Returns:
- the ManifestAttributesfor this entry, ornullif none
- Throws:
- IOException- if an I/O error has occurred
 
- 
getCertificatesReturns theCertificateobjects for this entry, ornullif none. This method can only be called once theJarEntryhas been completely verified by reading from the entry input stream until the end of the stream has been reached. Otherwise, this method will returnnull.It is recommended to use the getCodeSigners()method instead, which returns an array ofCodeSigners.The returned certificate array comprises all the signer certificates that were used to verify this entry. Each signer certificate is followed by its supporting certificate chain (which may be empty). Each signer certificate and its supporting certificate chain are ordered bottom-to-top (i.e., with the signer certificate first and the (root) certificate authority last). - API Note:
- The verification process does not include validating or establishing
trust in the code signers. A caller should perform additional checks,
such as using a CertPathValidatorto validate each signer's certificate chain, and determining whether to trust the entry signed by the signers.
- Returns:
- the Certificateobjects for this entry, ornullif none.
 
- 
getCodeSignersReturns theCodeSignerobjects for this entry, ornullif none. This method can only be called once theJarEntryhas been completely verified by reading from the entry input stream until the end of the stream has been reached. Otherwise, this method will returnnull.The returned array comprises all the code signers that have signed this entry. - API Note:
- The verification process does not include validating or establishing
trust in the code signers. A caller should perform additional checks,
such as using a CertPathValidatorto validate each signer's certificate chain, and determining whether to trust the entry signed by the signers.
- Returns:
- the CodeSignerobjects for this entry, ornullif none.
- Since:
- 1.5
 
- 
getRealNameReturns the real name of thisJarEntry. If thisJarEntryis an entry of a multi-release jar file and theJarFileis configured to be processed as such, the name returned by this method is the path name of the versioned entry that theJarEntryrepresents, rather than the path name of the base entry thatZipEntry.getName()returns. If theJarEntrydoes not represent a versioned entry of a multi-releaseJarFileor theJarFileis not configured for processing a multi-release jar file, this method returns the same name thatZipEntry.getName()returns.- Returns:
- the real name of the JarEntry
- Since:
- 10
 
 
-