public class Manifest extends Objectimplements Cloneable
Attributes
| Constructor and Description |
|---|
Manifest()
Constructs a new, empty Manifest.
|
Manifest(InputStream
Constructs a new Manifest from the specified input stream.
|
Manifest(Manifest
Constructs a new Manifest that is a copy of the specified Manifest.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears the main Attributes as well as the entries in this Manifest.
|
Object |
clone()
Returns a shallow copy of this Manifest.
|
boolean |
equals(Object
Returns true if the specified Object is also a Manifest and has the same main Attributes and entries.
|
Attributes |
getAttributes(String
Returns the Attributes for the specified entry name.
|
Map |
getEntries()
Returns a Map of the entries contained in this Manifest.
|
Attributes |
getMainAttributes()
Returns the main Attributes for the Manifest.
|
int |
hashCode()
Returns the hash code for this Manifest.
|
void |
read(InputStream
Reads the Manifest from the specified InputStream.
|
void |
write(OutputStream
Writes the Manifest to the specified OutputStream.
|
public Manifest()
public Manifest(InputStreamis) throws IOException
is - the input stream containing manifest data
IOException - if an I/O error has occurred
public Manifest(Manifestman)
man - the Manifest to copy
public AttributesgetMainAttributes()
public Map<String ,Attributes > getEntries()
null key, but no entry with a null key is created by
read(java.io.InputStream), nor is such an entry written by using
write(java.io.OutputStream).
public AttributesgetAttributes(String name)
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
public void clear()
public void write(OutputStreamout) throws IOException
out - the output stream
IOException - if an I/O error has occurred
getMainAttributes()
public void read(InputStreamis) throws IOException
is - the input stream
IOException - if an I/O error has occurred
public boolean equals(Objecto)
equals in class
Object
o - the object to be compared
Object.hashCode() ,
HashMap
public int hashCode()
hashCode in class
Object
Object.equals(java.lang.Object) ,
System.identityHashCode(java.lang.Object)