Skip to content

Most visited

Recently visited

navigation
Added in API level 1

Manifest

public class Manifest
extends Object implements Cloneable

java.lang.Object
   ↳ java.util.jar.Manifest


The Manifest class is used to obtain attribute information for a JarFile and its entries.

Summary

Public constructors

Manifest()

Creates a new Manifest instance.

Manifest(InputStream is)

Creates a new Manifest instance using the attributes obtained from the input stream.

Manifest(Manifest man)

Creates a new Manifest instance.

Public methods

void clear()

Resets the both the main attributes as well as the entry attributes associated with this Manifest.

Object clone()

Creates a copy of this Manifest.

boolean equals(Object o)

Determines if the receiver is equal to the parameter object.

Attributes getAttributes(String name)

Returns the Attributes associated with the parameter entry name.

Map<StringAttributes> getEntries()

Returns a map containing the Attributes for each entry in the Manifest.

Attributes getMainAttributes()

Returns the main Attributes of the JarFile.

int hashCode()

Returns the hash code for this instance.

void read(InputStream is)

Merges name/attribute pairs read from the input stream is into this manifest.

void write(OutputStream os)

Writes this Manifest's name/attributes pairs to the given OutputStream.

Inherited methods

From class java.lang.Object

Public constructors

Manifest

Added in API level 1
Manifest ()

Creates a new Manifest instance.

Manifest

Added in API level 1
Manifest (InputStream is)

Creates a new Manifest instance using the attributes obtained from the input stream.

Parameters
is InputStream: InputStream to parse for attributes.
Throws
IOException if an IO error occurs while creating this Manifest

Manifest

Added in API level 1
Manifest (Manifest man)

Creates a new Manifest instance. The new instance will have the same attributes as those found in the parameter Manifest.

Parameters
man Manifest: Manifest instance to obtain attributes from.

Public methods

clear

Added in API level 1
void clear ()

Resets the both the main attributes as well as the entry attributes associated with this Manifest.

clone

Added in API level 1
Object clone ()

Creates a copy of this Manifest. The returned Manifest will equal the Manifest from which it was cloned.

Returns
Object a copy of this instance.

equals

Added in API level 1
boolean equals (Object o)

Determines if the receiver is equal to the parameter object. Two Manifests are equal if they have identical main attributes as well as identical entry attributes.

Parameters
o Object: the object to compare against.
Returns
boolean true if the manifests are equal, false otherwise

getAttributes

Added in API level 1
Attributes getAttributes (String name)

Returns the Attributes associated with the parameter entry name.

Parameters
name String: the name of the entry to obtain Attributes from.
Returns
Attributes the Attributes for the entry or null if the entry does not exist.

getEntries

Added in API level 1
Map<StringAttributes> getEntries ()

Returns a map containing the Attributes for each entry in the Manifest.

Returns
Map<StringAttributes> the map of entry attributes.

getMainAttributes

Added in API level 1
Attributes getMainAttributes ()

Returns the main Attributes of the JarFile.

Returns
Attributes main Attributes associated with the source JarFile.

hashCode

Added in API level 1
int hashCode ()

Returns the hash code for this instance.

Returns
int this Manifest's hashCode.

read

Added in API level 1
void read (InputStream is)

Merges name/attribute pairs read from the input stream is into this manifest.

Parameters
is InputStream: The InputStream to read from.
Throws
IOException If an error occurs reading the manifest.

write

Added in API level 1
void write (OutputStream os)

Writes this Manifest's name/attributes pairs to the given OutputStream. The MANIFEST_VERSION or SIGNATURE_VERSION attribute must be set before calling this method, or no attributes will be written.

Parameters
os OutputStream
Throws
IOException If an error occurs writing the Manifest.
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.