| |
|
| java.lang.Object java.util.jar.Manifest
Manifest | public class Manifest implements Cloneable(Code) | | 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.
author: David Connelly version: 1.56, 05/05/07 See Also: Attributes since: 1.2 |
Constructor Summary | |
public | Manifest() Constructs a new, empty Manifest. | public | Manifest(InputStream is) Constructs a new Manifest from the specified input stream. | public | Manifest(Manifest man) Constructs a new Manifest that is a copy of the specified Manifest. |
Method Summary | |
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. | 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
null is a valid
name , when
getAttributes(null) is invoked on a
Manifest obtained from a jar file,
null will be returned. | public Map<String, Attributes> | getEntries() Returns a Map of the entries contained in this Manifest. | 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) Reads the Manifest from the specified InputStream. | public void | write(OutputStream out) Writes the Manifest to the specified OutputStream. |
Manifest | public Manifest()(Code) | | Constructs a new, empty Manifest.
|
Manifest | public Manifest(InputStream is) throws IOException(Code) | | Constructs a new Manifest from the specified input stream.
Parameters: is - the input stream containing manifest data throws: IOException - if an I/O error has occured |
Manifest | public Manifest(Manifest man)(Code) | | Constructs a new Manifest that is a copy of the specified Manifest.
Parameters: man - the Manifest to copy |
clear | public void clear()(Code) | | Clears the main Attributes as well as the entries in this Manifest.
|
clone | public Object clone()(Code) | | Returns a shallow copy of this Manifest. The shallow copy is
implemented as follows:
public Object clone() { return new Manifest(this); }
a shallow copy of this Manifest |
equals | public boolean equals(Object o)(Code) | | Returns true if the specified Object is also a Manifest and has
the same main Attributes and entries.
Parameters: o - the object to be compared true if the specified Object is also a Manifest and hasthe same main Attributes and entries |
getAttributes | public Attributes getAttributes(String name)(Code) | | Returns the Attributes for the specified entry name.
This method is defined as:
return (Attributes)getEntries().get(name)
Though
null is a valid
name , when
getAttributes(null) is invoked on a
Manifest obtained from a jar file,
null will be returned. While jar
files themselves do not allow
null -named attributes, it is
possible to invoke
Manifest.getEntries on a
Manifest , and
on that result, invoke
put with a null key and an
arbitrary value. Subsequent invocations of
getAttributes(null) will return the just-
put value.
Note that this method does not return the manifest's main attributes;
see
Manifest.getMainAttributes .
Parameters: name - entry name the Attributes for the specified entry name |
getEntries | public Map<String, Attributes> getEntries()(Code) | | 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
null key, but no entry with a null key is
created by
Manifest.read , nor is such an entry written by using
Manifest.write .
a Map of the entries contained in this Manifest |
getMainAttributes | public Attributes getMainAttributes()(Code) | | Returns the main Attributes for the Manifest.
the main Attributes for the Manifest |
hashCode | public int hashCode()(Code) | | Returns the hash code for this Manifest.
|
make72Safe | static void make72Safe(StringBuffer line)(Code) | | Adds line breaks to enforce a maximum 72 bytes per line.
|
read | public void read(InputStream is) throws IOException(Code) | | 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 exception: IOException - if an I/O error has occurred |
write | public void write(OutputStream out) throws IOException(Code) | | 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 exception: IOException - if an I/O error has occurred See Also: Manifest.getMainAttributes |
|
|
|