java.lang.Object
java.util.zip.ZipEntry
java.util.jar.JarEntry
- All Implemented Interfaces:
- Cloneable
public class JarEntry extends ZipEntry
This class is used to represent a JAR file entry.
- Since:
- 1.2
- 
Field SummaryFields Modifier and Type Field Description static intCENATTstatic intCENATXstatic intCENCOMstatic intCENCRCstatic intCENDSKstatic intCENEXTstatic intCENFLGstatic intCENHDRstatic intCENHOWstatic intCENLENstatic intCENNAMstatic intCENOFFstatic longCENSIGstatic intCENSIZstatic intCENTIMstatic intCENVEMstatic intCENVERstatic intENDCOMstatic intENDHDRstatic intENDOFFstatic longENDSIGstatic intENDSIZstatic intENDSUBstatic intENDTOTstatic intEXTCRCstatic intEXTHDRstatic intEXTLENstatic longEXTSIGstatic intEXTSIZstatic intLOCCRCstatic intLOCEXTstatic intLOCFLGstatic intLOCHDRstatic intLOCHOWstatic intLOCLENstatic intLOCNAMstatic longLOCSIGstatic intLOCSIZstatic intLOCTIMstatic intLOCVER
- 
Constructor SummaryConstructors Constructor Description JarEntry(String name)Creates a newJarEntryfor the specified JAR file entry name.JarEntry(JarEntry je)Creates a newJarEntrywith fields taken from the specifiedJarEntryobject.JarEntry(ZipEntry ze)Creates a newJarEntrywith fields taken from the specifiedZipEntryobject.
- 
Method SummaryModifier and Type Method Description AttributesgetAttributes()Returns theManifestAttributesfor this entry, ornullif none.Certificate[]getCertificates()Returns theCertificateobjects for this entry, ornullif none.CodeSigner[]getCodeSigners()Returns theCodeSignerobjects for this entry, ornullif none.StringgetRealName()Returns the real name of thisJarEntry.Methods declared in class java.util.zip.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- 
LOCSIGpublic static final long LOCSIG- See Also:
- Constant Field Values
 
- 
EXTSIGpublic static final long EXTSIG- See Also:
- Constant Field Values
 
- 
CENSIGpublic static final long CENSIG- See Also:
- Constant Field Values
 
- 
ENDSIGpublic static final long ENDSIG- See Also:
- Constant Field Values
 
- 
LOCHDRpublic static final int LOCHDR- See Also:
- Constant Field Values
 
- 
EXTHDRpublic static final int EXTHDR- See Also:
- Constant Field Values
 
- 
CENHDRpublic static final int CENHDR- See Also:
- Constant Field Values
 
- 
ENDHDRpublic static final int ENDHDR- See Also:
- Constant Field Values
 
- 
LOCVERpublic static final int LOCVER- See Also:
- Constant Field Values
 
- 
LOCFLGpublic static final int LOCFLG- See Also:
- Constant Field Values
 
- 
LOCHOWpublic static final int LOCHOW- See Also:
- Constant Field Values
 
- 
LOCTIMpublic static final int LOCTIM- See Also:
- Constant Field Values
 
- 
LOCCRCpublic static final int LOCCRC- See Also:
- Constant Field Values
 
- 
LOCSIZpublic static final int LOCSIZ- See Also:
- Constant Field Values
 
- 
LOCLENpublic static final int LOCLEN- See Also:
- Constant Field Values
 
- 
LOCNAMpublic static final int LOCNAM- See Also:
- Constant Field Values
 
- 
LOCEXTpublic static final int LOCEXT- See Also:
- Constant Field Values
 
- 
EXTCRCpublic static final int EXTCRC- See Also:
- Constant Field Values
 
- 
EXTSIZpublic static final int EXTSIZ- See Also:
- Constant Field Values
 
- 
EXTLENpublic static final int EXTLEN- See Also:
- Constant Field Values
 
- 
CENVEMpublic static final int CENVEM- See Also:
- Constant Field Values
 
- 
CENVERpublic static final int CENVER- See Also:
- Constant Field Values
 
- 
CENFLGpublic static final int CENFLG- See Also:
- Constant Field Values
 
- 
CENHOWpublic static final int CENHOW- See Also:
- Constant Field Values
 
- 
CENTIMpublic static final int CENTIM- See Also:
- Constant Field Values
 
- 
CENCRCpublic static final int CENCRC- See Also:
- Constant Field Values
 
- 
CENSIZpublic static final int CENSIZ- See Also:
- Constant Field Values
 
- 
CENLENpublic static final int CENLEN- See Also:
- Constant Field Values
 
- 
CENNAMpublic static final int CENNAM- See Also:
- Constant Field Values
 
- 
CENEXTpublic static final int CENEXT- See Also:
- Constant Field Values
 
- 
CENCOMpublic static final int CENCOM- See Also:
- Constant Field Values
 
- 
CENDSKpublic static final int CENDSK- See Also:
- Constant Field Values
 
- 
CENATTpublic static final int CENATT- See Also:
- Constant Field Values
 
- 
CENATXpublic static final int CENATX- See Also:
- Constant Field Values
 
- 
CENOFFpublic static final int CENOFF- See Also:
- Constant Field Values
 
- 
ENDSUBpublic static final int ENDSUB- See Also:
- Constant Field Values
 
- 
ENDTOTpublic static final int ENDTOT- See Also:
- Constant Field Values
 
- 
ENDSIZpublic static final int ENDSIZ- See Also:
- Constant Field Values
 
- 
ENDOFFpublic static final int ENDOFF- See Also:
- Constant Field Values
 
- 
ENDCOMpublic static final int ENDCOM- See Also:
- Constant Field Values
 
 
- 
- 
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
 
- 
JarEntryCreates a newJarEntrywith fields taken from the specifiedJarEntryobject.- Parameters:
- je- the- JarEntryto copy
 
 
- 
- 
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.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). - 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. - 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
 
 
-