public class

Manifest

extends Object
implements Cloneable
java.lang.Object
   ↳ java.util.jar.Manifest

Class Overview

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)
Constructs a new Manifest instance obtaining attribute information from the specified input stream.
void write(OutputStream os)
Writes out the attribute information of the receiver to the specified OutputStream.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Manifest ()

Creates a new Manifest instance.

public Manifest (InputStream is)

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

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

public 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 instance to obtain attributes from.

Public Methods

public void clear ()

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

public Object clone ()

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

Returns
  • a copy of this instance.

public 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 the object to compare against.
Returns
  • true if the manifests are equal, false otherwise

public Attributes getAttributes (String name)

Returns the Attributes associated with the parameter entry name.

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

public Map<StringAttributes> getEntries ()

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

Returns
  • the map of entry attributes.

public Attributes getMainAttributes ()

Returns the main Attributes of the JarFile.

Returns
  • main Attributes associated with the source JarFile.

public int hashCode ()

Returns the hash code for this instance.

Returns
  • this Manifest's hashCode.

public void read (InputStream is)

Constructs a new Manifest instance obtaining attribute information from the specified input stream.

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

public void write (OutputStream os)

Writes out the attribute information of the receiver to the specified OutputStream.

Parameters
os The OutputStream to write to.
Throws
IOException If an error occurs writing the Manifest.