Home » openjdk-7 » java » util » jar » [javadoc | source]
public class: Manifest [javadoc | source]

All Implemented Interfaces:

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.
Nested Class Summary:
static class  Manifest.FastInputStream   
 public Manifest() 
 public Manifest(InputStream is) throws IOException 
    Constructs a new Manifest from the specified input stream.
    is - the input stream containing manifest data
    IOException - if an I/O error has occured
 public Manifest(Manifest man) 
    Constructs a new Manifest that is a copy of the specified Manifest.
    man - the Manifest to copy
Method from java.util.jar.Manifest Summary:
clear,   clone,   equals,   getAttributes,   getEntries,   getMainAttributes,   hashCode,   make72Safe,   read,   write
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from java.util.jar.Manifest Detail:
 public  void clear() 
    Clears the main Attributes as well as the entries in this Manifest.
 public Object clone() 
    Returns a shallow copy of this Manifest. The shallow copy is implemented as follows:
        public Object clone() { return new Manifest(this); }
 public boolean equals(Object o) 
    Returns true if the specified Object is also a Manifest and has the same main Attributes and entries.
 public Attributes getAttributes(String name) 
    Returns the Attributes for the specified entry name. This method is defined as:
         return (Attributes)getEntries().get(name)
    Though {@code null} is a valid {@code name}, when {@code getAttributes(null)} is invoked on a {@code Manifest} obtained from a jar file, {@code null} will be returned. While jar files themselves do not allow {@code null}-named attributes, it is possible to invoke #getEntries on a {@code Manifest}, and on that result, invoke {@code put} with a null key and an arbitrary value. Subsequent invocations of {@code getAttributes(null)} will return the just-{@code put} value.

    Note that this method does not return the manifest's main attributes; see #getMainAttributes .

 public Map<String, 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). The Map permits the {@code null} key, but no entry with a null key is created by #read , nor is such an entry written by using #write .
 public Attributes getMainAttributes() 
    Returns the main Attributes for the Manifest.
 public int hashCode() 
    Returns the hash code for this Manifest.
 static  void make72Safe(StringBuffer line) 
    Adds line breaks to enforce a maximum 72 bytes per line.
 public  void read(InputStream is) throws IOException 
    Reads the Manifest from the specified InputStream. The entry names and attributes read will be merged in with the current manifest entries.
 public  void write(OutputStream out) throws IOException 
    Writes the Manifest to the specified OutputStream. Attributes.Name.MANIFEST_VERSION must be set in MainAttributes prior to invoking this method.