Stay organized with collections
Save and categorize content based on your preferences.
JarEntry
public
class
JarEntry
extends ZipEntry
This class is used to represent a JAR file entry.
Summary
Inherited constants |
From class
java.util.zip.ZipEntry
int |
CENATT
Central directory (CEN) header internal file attributes field offset.
|
int |
CENATX
Central directory (CEN) header external file attributes field offset.
|
int |
CENCOM
Central directory (CEN) header comment length field offset.
|
int |
CENCRC
Central directory (CEN) header uncompressed file crc-32 value field offset.
|
int |
CENDSK
Central directory (CEN) header disk number start field offset.
|
int |
CENEXT
Central directory (CEN) header extra field length field offset.
|
int |
CENFLG
Central directory (CEN) header encrypt, decrypt flags field offset.
|
int |
CENHDR
Central directory (CEN) header size in bytes (including signature).
|
int |
CENHOW
Central directory (CEN) header compression method field offset.
|
int |
CENLEN
Central directory (CEN) header uncompressed size field offset.
|
int |
CENNAM
Central directory (CEN) header filename length field offset.
|
int |
CENOFF
Central directory (CEN) header LOC header offset field offset.
|
long |
CENSIG
Central directory (CEN) header signature.
|
int |
CENSIZ
Central directory (CEN) header compressed size field offset.
|
int |
CENTIM
Central directory (CEN) header modification time field offset.
|
int |
CENVEM
Central directory (CEN) header version made by field offset.
|
int |
CENVER
Central directory (CEN) header version needed to extract field offset.
|
int |
DEFLATED
Compression method for compressed (deflated) entries.
|
int |
ENDCOM
End of central directory (END) header zip file comment length field offset.
|
int |
ENDHDR
End of central directory (END) header size in bytes (including signature).
|
int |
ENDOFF
End of central directory (END) header offset for the first CEN header field offset.
|
long |
ENDSIG
End of central directory (END) header signature.
|
int |
ENDSIZ
End of central directory (END) header central directory size in bytes field offset.
|
int |
ENDSUB
End of central directory (END) header number of entries on this disk field offset.
|
int |
ENDTOT
End of central directory (END) header total number of entries field offset.
|
int |
EXTCRC
Extra local (EXT) header uncompressed file crc-32 value field offset.
|
int |
EXTHDR
Extra local (EXT) header size in bytes (including signature).
|
int |
EXTLEN
Extra local (EXT) header uncompressed size field offset.
|
long |
EXTSIG
Extra local (EXT) header signature.
|
int |
EXTSIZ
Extra local (EXT) header compressed size field offset.
|
int |
LOCCRC
Local file (LOC) header uncompressed file crc-32 value field offset.
|
int |
LOCEXT
Local file (LOC) header extra field length field offset.
|
int |
LOCFLG
Local file (LOC) header general purpose bit flag field offset.
|
int |
LOCHDR
Local file (LOC) header size in bytes (including signature).
|
int |
LOCHOW
Local file (LOC) header compression method field offset.
|
int |
LOCLEN
Local file (LOC) header uncompressed size field offset.
|
int |
LOCNAM
Local file (LOC) header filename length field offset.
|
long |
LOCSIG
Local file (LOC) header signature.
|
int |
LOCSIZ
Local file (LOC) header compressed size field offset.
|
int |
LOCTIM
Local file (LOC) header modification time field offset.
|
int |
LOCVER
Local file (LOC) header version needed to extract field offset.
|
int |
STORED
Compression method for uncompressed entries.
|
|
Public constructors |
JarEntry(String name)
Creates a new JarEntry for the specified JAR file
entry name.
|
JarEntry(JarEntry je)
Creates a new JarEntry with fields taken from the
specified JarEntry object.
|
JarEntry(ZipEntry ze)
Creates a new JarEntry with fields taken from the
specified ZipEntry object.
|
Inherited methods |
|
|
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object.
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait(long timeoutMillis, int nanos)
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted, or until a
certain amount of real time has elapsed.
|
final
void
|
wait(long timeoutMillis)
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted, or until a
certain amount of real time has elapsed.
|
final
void
|
wait()
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted.
|
|
Public constructors
JarEntry
public JarEntry (String name)
Creates a new JarEntry for the specified JAR file
entry name.
| Parameters |
name |
String: the JAR file entry name |
JarEntry
public JarEntry (JarEntry je)
Creates a new JarEntry with fields taken from the
specified JarEntry object.
| Parameters |
je |
JarEntry: the JarEntry to copy |
JarEntry
public JarEntry (ZipEntry ze)
Creates a new JarEntry with fields taken from the
specified ZipEntry object.
| Parameters |
ze |
ZipEntry: the ZipEntry object to create the
JarEntry from |
Public methods
getAttributes
public Attributes getAttributes ()
Returns the Manifest Attributes for this
entry, or null if none.
| Returns |
Attributes |
the Manifest Attributes for this
entry, or null if none |
getCertificates
public Certificate[] getCertificates ()
Returns the Certificate objects for this entry, or
null if none. This method can only be called once
the JarEntry has been completely verified by reading
from the entry input stream until the end of the stream has been
reached. Otherwise, this method will return null.
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 |
Certificate[] |
the Certificate objects for this entry, or
null if none. |
getCodeSigners
public CodeSigner[] getCodeSigners ()
Returns the CodeSigner objects for this entry, or
null if none. This method can only be called once
the JarEntry has been completely verified by reading
from the entry input stream until the end of the stream has been
reached. Otherwise, this method will return null.
The returned array comprises all the code signers that have signed
this entry.
| Returns |
CodeSigner[] |
the CodeSigner objects for this entry, or
null if none. |
getRealName
public String getRealName ()
This method returns the same name that ZipEntry.getName() returns.
| Returns |
String |
the real name of the JarEntry |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2026-06-23 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-06-23 UTC."],[],[]]