java.lang.Object | |
↳ | java.util.jar.Manifest |
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.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new, empty Manifest.
| |||||||||||
Constructs a new Manifest from the specified input stream.
| |||||||||||
Constructs a new Manifest that is a copy of the specified Manifest.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Clears the main Attributes as well as the entries in this Manifest.
| |||||||||||
Returns a shallow copy of this Manifest.
| |||||||||||
Returns true if the specified Object is also a Manifest and has
the same main Attributes and entries.
| |||||||||||
Returns the Attributes for the specified entry name.
| |||||||||||
Returns a Map of the entries contained in this Manifest.
| |||||||||||
Returns the main Attributes for the Manifest.
| |||||||||||
Returns the hash code for this Manifest.
| |||||||||||
Reads the Manifest from the specified InputStream.
| |||||||||||
Writes the Manifest to the specified OutputStream.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Constructs a new, empty Manifest.
Constructs a new Manifest from the specified input stream.
is | the input stream containing manifest data |
---|
IOException | if an I/O error has occured |
---|
Constructs a new Manifest that is a copy of the specified Manifest.
man | the Manifest to copy |
---|
Clears the main Attributes as well as the entries in this Manifest.
Returns a shallow copy of this Manifest. The shallow copy is implemented as follows:
public Object clone() { return new Manifest(this); }
Returns true if the specified Object is also a Manifest and has the same main Attributes and entries.
o | the object to be compared |
---|
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 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 getMainAttributes()
.
name | entry name |
---|
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 read(InputStream)
, nor is such an entry written by using write(OutputStream)
.
Returns the main Attributes for the Manifest.
Returns the hash code for this Manifest.
Reads the Manifest from the specified InputStream. The entry names and attributes read will be merged in with the current manifest entries.
is | the input stream |
---|
IOException | if an I/O error has occurred |
---|
Writes the Manifest to the specified OutputStream. Attributes.Name.MANIFEST_VERSION must be set in MainAttributes prior to invoking this method.
out | the output stream |
---|
IOException | if an I/O error has occurred |
---|