JarEntry
Stay organized with collections
Save and categorize content based on your preferences.
This class is used to represent a JAR file entry.
Inherited Constant Summary
Public Constructor Summary
|
JarEntry( String name)
Creates a new JarEntry for the specified JAR file
entry name.
|
|
JarEntry( ZipEntry ze)
Creates a new JarEntry with fields taken from the
specified ZipEntry object.
|
|
JarEntry( JarEntry je)
Creates a new JarEntry with fields taken from the
specified JarEntry object.
|
Inherited Method Summary
From class
java.util.zip.ZipEntry
Object
|
clone()
Returns a copy of this entry.
|
String
|
getComment()
Returns the comment string for the entry.
|
long
|
|
long
|
getCrc()
Returns the CRC-32 checksum of the uncompressed entry data.
|
FileTime
|
|
byte[]
|
getExtra()
Returns the extra field data for the entry.
|
FileTime
|
|
FileTime
|
|
int
|
getMethod()
Returns the compression method of the entry.
|
String
|
getName()
Returns the name of the entry.
|
long
|
getSize()
Returns the uncompressed size of the entry data.
|
long
|
getTime()
Returns the last modification time of the entry.
|
int
|
hashCode()
Returns the hash code value for this entry.
|
boolean
|
isDirectory()
Returns true if this is a directory entry.
|
void
|
|
void
|
|
void
|
setCrc(long crc)
Sets the CRC-32 checksum of the uncompressed entry data.
|
ZipEntry
|
|
void
|
setExtra(byte[] extra)
Sets the optional extra field data for the entry.
|
ZipEntry
|
|
ZipEntry
|
|
void
|
setMethod(int method)
Sets the compression method for the entry.
|
void
|
setSize(long size)
Sets the uncompressed size of the entry data.
|
void
|
setTime(long time)
Sets the last modification time of the entry.
|
String
|
toString()
Returns a string representation of the ZIP entry.
|
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this Object .
|
boolean
|
equals( Object obj)
Compares this instance with the specified object and indicates if they
are equal.
|
void
|
finalize()
Invoked when the garbage collector has detected that this instance is no longer reachable.
|
final
Class<?>
|
getClass()
Returns the unique instance of Class that represents this
object's class.
|
int
|
hashCode()
Returns an integer hash code for this object.
|
final
void
|
notify()
Causes a thread which is waiting on this object's monitor (by means of
calling one of the wait() methods) to be woken up.
|
final
void
|
notifyAll()
Causes all threads which are waiting on this object's monitor (by means
of calling one of the wait() methods) to be woken up.
|
String
|
toString()
Returns a string containing a concise, human-readable description of this
object.
|
final
void
|
wait(long timeout, int nanos)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
final
void
|
wait(long timeout)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
final
void
|
wait()
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.
|
Public Constructors
public
JarEntry
(String name)
Creates a new JarEntry
for the specified JAR file
entry name.
Parameters
name |
the JAR file entry name |
public
JarEntry
(ZipEntry ze)
Creates a new JarEntry
with fields taken from the
specified ZipEntry
object.
Parameters
ze |
the ZipEntry object to create the
JarEntry from
|
public
JarEntry
(JarEntry je)
Creates a new JarEntry
with fields taken from the
specified JarEntry
object.
Public Methods
public
Attributes
getAttributes
()
Returns the Manifest
Attributes
for this
entry, or null
if none.
Returns
- the
Manifest
Attributes
for this
entry, or null
if none
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
- the
Certificate
objects for this entry, or
null
if none.
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
- the
CodeSigner
objects for this entry, or
null
if none.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-07-10 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 2024-07-10 UTC."],[[["`JarEntry` represents an entry within a JAR file, extending the functionality of `ZipEntry`."],["It provides methods to access entry-specific information like Manifest attributes, certificates, and code signers."],["Constructors allow creation from a filename, a `ZipEntry`, or another `JarEntry`."],["Inherits methods from `ZipEntry` for managing entry metadata like size, compression, timestamps, and comments."],["`getAttributes`, `getCertificates`, and `getCodeSigners` provide access to security and manifest details."]]],[]]