Constructor and Description |
---|
StrictJarManifest()
Creates a new
StrictJarManifest instance. |
StrictJarManifest(InputStream is)
Creates a new
StrictJarManifest instance using the attributes obtained
from the input stream. |
StrictJarManifest(StrictJarManifest man)
Creates a new
StrictJarManifest instance. |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Resets the both the main attributes as well as the entry attributes
associated with this
StrictJarManifest . |
Object |
clone()
Creates a copy of this
StrictJarManifest . |
boolean |
equals(Object o)
Determines if the receiver is equal to the parameter object.
|
Attributes |
getAttributes(String name)
Returns the
Attributes associated with the parameter entry
name . |
Map<String,Attributes> |
getEntries()
Returns a map containing the
Attributes for each entry in the
StrictJarManifest . |
Attributes |
getMainAttributes()
Returns the main
Attributes of the JarFile . |
int |
hashCode()
Returns the hash code for this instance.
|
void |
read(InputStream is)
Merges name/attribute pairs read from the input stream
is into this manifest. |
void |
write(OutputStream os)
Writes this
StrictJarManifest 's name/attributes pairs to the given OutputStream . |
public StrictJarManifest()
StrictJarManifest
instance.public StrictJarManifest(InputStream is) throws IOException
StrictJarManifest
instance using the attributes obtained
from the input stream.is
- InputStream
to parse for attributes.IOException
- if an IO error occurs while creating this StrictJarManifest
public StrictJarManifest(StrictJarManifest man)
StrictJarManifest
instance. The new instance will have the
same attributes as those found in the parameter StrictJarManifest
.man
- StrictJarManifest
instance to obtain attributes from.public void clear()
StrictJarManifest
.public Attributes getAttributes(String name)
Attributes
associated with the parameter entry
name
.name
- the name of the entry to obtain Attributes
from.null
if the entry does
not exist.public Map<String,Attributes> getEntries()
Attributes
for each entry in the
StrictJarManifest
.public Attributes getMainAttributes()
Attributes
of the JarFile
.Attributes
associated with the source JarFile
.public Object clone()
StrictJarManifest
. The returned StrictJarManifest
will equal the StrictJarManifest
from which it was cloned.public void write(OutputStream os) throws IOException
StrictJarManifest
's name/attributes pairs to the given OutputStream
.
The MANIFEST_VERSION
or SIGNATURE_VERSION
attribute must be set before
calling this method, or no attributes will be written.IOException
- If an error occurs writing the StrictJarManifest
.public void read(InputStream is) throws IOException
is
into this manifest.is
- The InputStream
to read from.IOException
- If an error occurs reading the manifest.public int hashCode()
hashCode
in class Object
StrictJarManifest
's hashCode.Object.equals(java.lang.Object)
,
System.identityHashCode(java.lang.Object)
public boolean equals(Object o)
StrictJarManifest
s are equal if they have identical main attributes as well as
identical entry attributes.equals
in class Object
o
- the object to compare against.true
if the manifests are equal, false
otherwiseObject.hashCode()
,
HashMap