java.util.jar
Class Manifest

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.util.jar.Manifest
All Implemented Interfaces:
Cloneable sample code for java.lang.Cloneable definition code for java.lang.Cloneable

public class Manifest
extends Object sample code for java.lang.Object definition code for java.lang.Object
implements Cloneable sample code for java.lang.Cloneable definition code for java.lang.Cloneable

The Manifest class is used to maintain Manifest entry names and their associated Attributes. There are main Manifest Attributes as well as per-entry Attributes. For information on the Manifest format, please see the Manifest format specification.

Since:
1.2
See Also:
Attributes sample code for java.util.jar.Attributes definition code for java.util.jar.Attributes

Constructor Summary
Manifest sample code for java.util.jar.Manifest.Manifest() definition code for java.util.jar.Manifest.Manifest() ()
          Constructs a new, empty Manifest.
Manifest sample code for java.util.jar.Manifest.Manifest(java.io.InputStream) definition code for java.util.jar.Manifest.Manifest(java.io.InputStream) (InputStream sample code for java.io.InputStream definition code for java.io.InputStream  is)
          Constructs a new Manifest from the specified input stream.
Manifest sample code for java.util.jar.Manifest.Manifest(java.util.jar.Manifest) definition code for java.util.jar.Manifest.Manifest(java.util.jar.Manifest) (Manifest sample code for java.util.jar.Manifest definition code for java.util.jar.Manifest  man)
          Constructs a new Manifest that is a copy of the specified Manifest.
 
Method Summary
 void clear sample code for java.util.jar.Manifest.clear() definition code for java.util.jar.Manifest.clear() ()
          Clears the main Attributes as well as the entries in this Manifest.
 Object sample code for java.lang.Object definition code for java.lang.Object clone sample code for java.util.jar.Manifest.clone() definition code for java.util.jar.Manifest.clone() ()
          Returns a shallow copy of this Manifest.
 boolean equals sample code for java.util.jar.Manifest.equals(java.lang.Object) definition code for java.util.jar.Manifest.equals(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  o)
          Returns true if the specified Object is also a Manifest and has the same main Attributes and entries.
 Attributes sample code for java.util.jar.Attributes definition code for java.util.jar.Attributes getAttributes sample code for java.util.jar.Manifest.getAttributes(java.lang.String) definition code for java.util.jar.Manifest.getAttributes(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  name)
          Returns the Attributes for the specified entry name.
 Map sample code for java.util.Map definition code for java.util.Map <String sample code for java.lang.String definition code for java.lang.String ,Attributes sample code for java.util.jar.Attributes definition code for java.util.jar.Attributes > getEntries sample code for java.util.jar.Manifest.getEntries() definition code for java.util.jar.Manifest.getEntries() ()
          Returns a Map of the entries contained in this Manifest.
 Attributes sample code for java.util.jar.Attributes definition code for java.util.jar.Attributes getMainAttributes sample code for java.util.jar.Manifest.getMainAttributes() definition code for java.util.jar.Manifest.getMainAttributes() ()
          Returns the main Attributes for the Manifest.
 int hashCode sample code for java.util.jar.Manifest.hashCode() definition code for java.util.jar.Manifest.hashCode() ()
          Returns the hash code for this Manifest.
 void read sample code for java.util.jar.Manifest.read(java.io.InputStream) definition code for java.util.jar.Manifest.read(java.io.InputStream) (InputStream sample code for java.io.InputStream definition code for java.io.InputStream  is)
          Reads the Manifest from the specified InputStream.
 void write sample code for java.util.jar.Manifest.write(java.io.OutputStream) definition code for java.util.jar.Manifest.write(java.io.OutputStream) (OutputStream sample code for java.io.OutputStream definition code for java.io.OutputStream  out)
          Writes the Manifest to the specified OutputStream.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

Manifest sample code for java.util.jar.Manifest() definition code for java.util.jar.Manifest()

public Manifest()
Constructs a new, empty Manifest.


Manifest sample code for java.util.jar.Manifest(java.io.InputStream) definition code for java.util.jar.Manifest(java.io.InputStream)

public Manifest(InputStream sample code for java.io.InputStream definition code for java.io.InputStream  is)
         throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Constructs a new Manifest from the specified input stream.

Parameters:
is - the input stream containing manifest data
Throws:
IOException sample code for java.io.IOException definition code for java.io.IOException - if an I/O error has occured

Manifest sample code for java.util.jar.Manifest(java.util.jar.Manifest) definition code for java.util.jar.Manifest(java.util.jar.Manifest)

public Manifest(Manifest sample code for java.util.jar.Manifest definition code for java.util.jar.Manifest  man)
Constructs a new Manifest that is a copy of the specified Manifest.

Parameters:
man - the Manifest to copy
Method Detail

getMainAttributes sample code for java.util.jar.Manifest.getMainAttributes() definition code for java.util.jar.Manifest.getMainAttributes()

public Attributes sample code for java.util.jar.Attributes definition code for java.util.jar.Attributes  getMainAttributes()
Returns the main Attributes for the Manifest.

Returns:
the main Attributes for the Manifest

getEntries sample code for java.util.jar.Manifest.getEntries() definition code for java.util.jar.Manifest.getEntries()

public Map sample code for java.util.Map definition code for java.util.Map <String sample code for java.lang.String definition code for java.lang.String ,Attributes sample code for java.util.jar.Attributes definition code for java.util.jar.Attributes > getEntries()
Returns a Map of the entries contained in this Manifest. Each entry is represented by a String name (key) and associated Attributes (value).

Returns:
a Map of the entries contained in this Manifest

getAttributes sample code for java.util.jar.Manifest.getAttributes(java.lang.String) definition code for java.util.jar.Manifest.getAttributes(java.lang.String)

public Attributes sample code for java.util.jar.Attributes definition code for java.util.jar.Attributes  getAttributes(String sample code for java.lang.String definition code for java.lang.String  name)
Returns the Attributes for the specified entry name. This method is defined as:
            return (Attributes)getEntries().get(name)
 

Parameters:
name - entry name
Returns:
the Attributes for the specified entry name

clear sample code for java.util.jar.Manifest.clear() definition code for java.util.jar.Manifest.clear()

public void clear()
Clears the main Attributes as well as the entries in this Manifest.


write sample code for java.util.jar.Manifest.write(java.io.OutputStream) definition code for java.util.jar.Manifest.write(java.io.OutputStream)

public void write(OutputStream sample code for java.io.OutputStream definition code for java.io.OutputStream  out)
           throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Writes the Manifest to the specified OutputStream. Attributes.Name.MANIFEST_VERSION must be set in MainAttributes prior to invoking this method.

Parameters:
out - the output stream
Throws:
IOException sample code for java.io.IOException definition code for java.io.IOException - if an I/O error has occurred
See Also:
getMainAttributes() sample code for java.util.jar.Manifest.getMainAttributes() definition code for java.util.jar.Manifest.getMainAttributes()

read sample code for java.util.jar.Manifest.read(java.io.InputStream) definition code for java.util.jar.Manifest.read(java.io.InputStream)

public void read(InputStream sample code for java.io.InputStream definition code for java.io.InputStream  is)
          throws IOException sample code for java.io.IOException definition code for java.io.IOException 
Reads the Manifest from the specified InputStream. The entry names and attributes read will be merged in with the current manifest entries.

Parameters:
is - the input stream
Throws:
IOException sample code for java.io.IOException definition code for java.io.IOException - if an I/O error has occurred

equals sample code for java.util.jar.Manifest.equals(java.lang.Object) definition code for java.util.jar.Manifest.equals(java.lang.Object)

public boolean equals(Object sample code for java.lang.Object definition code for java.lang.Object  o)
Returns true if the specified Object is also a Manifest and has the same main Attributes and entries.

Overrides:
equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) in class Object sample code for java.lang.Object definition code for java.lang.Object
Parameters:
o - the object to be compared
Returns:
true if the specified Object is also a Manifest and has the same main Attributes and entries
See Also:
Object.hashCode() sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable

hashCode sample code for java.util.jar.Manifest.hashCode() definition code for java.util.jar.Manifest.hashCode()

public int hashCode()
Returns the hash code for this Manifest.

Overrides:
hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() in class Object sample code for java.lang.Object definition code for java.lang.Object
Returns:
a hash code value for this object.
See Also:
Object.equals(java.lang.Object) sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable

clone sample code for java.util.jar.Manifest.clone() definition code for java.util.jar.Manifest.clone()

public Object sample code for java.lang.Object definition code for java.lang.Object  clone()
Returns a shallow copy of this Manifest. The shallow copy is implemented as follows:
     public Object clone() { return new Manifest(this); }
 

Overrides:
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() in class Object sample code for java.lang.Object definition code for java.lang.Object
Returns:
a shallow copy of this Manifest
See Also:
Cloneable sample code for java.lang.Cloneable definition code for java.lang.Cloneable