Android APIs
public class

JarEntry

extends ZipEntry
java.lang.Object
   ↳ java.util.zip.ZipEntry
     ↳ java.util.jar.JarEntry

Class Overview

Represents a single file in a JAR archive together with the manifest attributes and digital signatures associated with it.

Summary

[Expand]
Inherited Constants
From class java.util.zip.ZipEntry
Public Constructors
JarEntry(String name)
Creates a new JarEntry named name.
JarEntry(ZipEntry entry)
Creates a new JarEntry using the values obtained from entry.
JarEntry(JarEntry je)
Create a new JarEntry using the values obtained from the argument.
Public Methods
Attributes getAttributes()
Returns the Attributes object associated with this entry or null if none exists.
Certificate[] getCertificates()
Returns an array of Certificate Objects associated with this entry or null if none exists.
CodeSigner[] getCodeSigners()
Returns the code signers for the digital signatures associated with the JAR file.
[Expand]
Inherited Methods
From class java.util.zip.ZipEntry
From class java.lang.Object

Public Constructors

public JarEntry (String name)

Added in API level 1

Creates a new JarEntry named name.

Parameters
name The name of the new JarEntry.

public JarEntry (ZipEntry entry)

Added in API level 1

Creates a new JarEntry using the values obtained from entry.

Parameters
entry The ZipEntry to obtain values from.

public JarEntry (JarEntry je)

Added in API level 1

Create a new JarEntry using the values obtained from the argument.

Parameters
je The JarEntry to obtain values from.

Public Methods

public Attributes getAttributes ()

Added in API level 1

Returns the Attributes object associated with this entry or null if none exists.

Returns
  • the Attributes for this entry.
Throws
IOException If an error occurs obtaining the Attributes.
See Also

public Certificate[] getCertificates ()

Added in API level 1

Returns an array of Certificate Objects associated with this entry or null if none exists. Make sure that the everything is read from the input stream before calling this method, or else the method returns null.

This method returns all the signers' unverified chains concatenated together in one array. To know which certificates were tied to the private keys that made the signatures on this entry, see getCodeSigners() instead.

See Also

public CodeSigner[] getCodeSigners ()

Added in API level 1

Returns the code signers for the digital signatures associated with the JAR file. If there is no such code signer, it returns null. Make sure that the everything is read from the input stream before calling this method, or else the method returns null.

Only the digital signature on the entry is cryptographically verified. None of the certificates in the the CertPath returned from getSignerCertPath() are verified and must be verified by the caller if needed. See CertPathValidator for more information.

Returns
  • an array of CodeSigner for this JAR entry.
See Also