Spec-Zone .ru
спецификации, руководства, описания, API
|
|
Java™ Platform Standard Ed. 7 DRAFT ea-b118 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.jar.Manifest
public class Manifest extends Object implements Cloneable
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.
Attributes
Constructor and Description |
---|
Manifest()
Constructs a new, empty Manifest. |
Manifest(InputStream is)
Constructs a new Manifest from the specified input stream. |
Manifest(Manifest man)
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 o)
Returns true if the specified Object is also a Manifest and has the same main Attributes and entries. |
Attributes |
getAttributes(String name)
Returns the Attributes for the specified entry name. |
Map<String,Attributes> |
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 is)
Reads the Manifest from the specified InputStream. |
void |
write(OutputStream out)
Writes the Manifest to the specified OutputStream. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Manifest()
public Manifest(InputStream is) throws IOException
is
- the input stream containing manifest dataIOException
- if an I/O error has occuredpublic Manifest(Manifest man)
man
- the Manifest to copyMethod Detail |
---|
public Attributes getMainAttributes()
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 Attributes getAttributes(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 namepublic void clear()
public void write(OutputStream out) throws IOException
out
- the output streamIOException
- if an I/O error has occurredgetMainAttributes()
public void read(InputStream is) throws IOException
is
- the input streamIOException
- if an I/O error has occurredpublic boolean equals(Object o)
equals
in class Object
o
- the object to be comparedObject.hashCode()
,
HashMap
public int hashCode()
hashCode
in class Object
Object.equals(java.lang.Object)
,
System.identityHashCode(java.lang.Object)
public Object clone()
public Object clone() { return new Manifest(this); }
clone
in class Object
Cloneable
|
Java™ Platform Standard Ed. 7 DRAFT ea-b118 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1993, 2010, Oracle Corporation. All rights reserved.