|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.plexus.archiver.jar.Manifest
public class Manifest
Holds the data of a jar manifest.
Manifests are processed according to the Jar file specification.. Specifically, a manifest element consists of a set of attributes and sections. These sections in turn may contain attributes. Note in particular that this may result in manifest lines greater than 72 bytes being wrapped and continued on the next line. If an application can not handle the continuation mechanism, it is a defect in the application, not this task.
Nested Class Summary | |
---|---|
static class |
Manifest.Attribute
An attribute for the manifest. |
static class |
Manifest.Section
A manifest section - you can nest attribute elements into sections. |
Field Summary | |
---|---|
static String |
ATTRIBUTE_CLASSPATH
The Class-Path Header is special - it can be duplicated |
static String |
ATTRIBUTE_FROM
The From Header is disallowed in a Manifest |
static String |
ATTRIBUTE_MANIFEST_VERSION
The standard manifest version header |
static String |
ATTRIBUTE_NAME
The Name Attribute is the first in a named section |
static String |
ATTRIBUTE_SIGNATURE_VERSION
The standard Signature Version header |
static String |
DEFAULT_MANIFEST_VERSION
Default Manifest version if one is not specified |
static String |
EOL
The End-Of-Line marker in manifests |
static int |
MAX_LINE_LENGTH
The max length of a line in a Manifest |
static int |
MAX_SECTION_LENGTH
Max length of a line section which is continued. |
Constructor Summary | |
---|---|
Manifest()
Construct an empty manifest |
|
Manifest(Reader r)
Read a manifest file from the given reader |
Method Summary | |
---|---|
void |
addConfiguredAttribute(Manifest.Attribute attribute)
Add an attribute to the manifest - it is added to the main section. |
void |
addConfiguredSection(Manifest.Section section)
Add a section to the manifest |
boolean |
equals(Object rhs)
|
static Manifest |
getDefaultManifest()
Construct a manifest from Ant's default manifest file. |
Manifest.Section |
getMainSection()
Get the main section of the manifest |
String |
getManifestVersion()
Get the version of the manifest |
Manifest.Section |
getSection(String name)
Get a particular section from the manifest |
Enumeration |
getSectionNames()
Get the section names in this manifest. |
Enumeration |
getWarnings()
Get the warnings for this manifest. |
int |
hashCode()
|
void |
merge(Manifest other)
Merge the contents of the given manifest into this manifest |
void |
merge(Manifest other,
boolean overwriteMain)
Merge the contents of the given manifest into this manifest |
String |
toString()
Convert the manifest to its string representation |
void |
write(PrintWriter writer)
Write the manifest out to a print writer. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String ATTRIBUTE_MANIFEST_VERSION
public static final String ATTRIBUTE_SIGNATURE_VERSION
public static final String ATTRIBUTE_NAME
public static final String ATTRIBUTE_FROM
public static final String ATTRIBUTE_CLASSPATH
public static final String DEFAULT_MANIFEST_VERSION
public static final int MAX_LINE_LENGTH
public static final int MAX_SECTION_LENGTH
public static final String EOL
Constructor Detail |
---|
public Manifest()
public Manifest(Reader r) throws ManifestException, IOException
r
- is the reader from which the Manifest is read
ManifestException
- if the manifest is not valid according
to the JAR spec
IOException
- if the manifest cannot be read from the reader.Method Detail |
---|
public static Manifest getDefaultManifest() throws ArchiverException
ArchiverException
- if there is a problem loading the
default manifestpublic void addConfiguredSection(Manifest.Section section) throws ManifestException
section
- the manifest section to be added
ManifestException
- if the secti0on is not valid.public void addConfiguredAttribute(Manifest.Attribute attribute) throws ManifestException
attribute
- the attribute to be added.
ManifestException
- if the attribute is not valid.public void merge(Manifest other) throws ManifestException
other
- the Manifest to be merged with this one.
ManifestException
- if there is a problem merging the
manifest according to the Manifest spec.public void merge(Manifest other, boolean overwriteMain) throws ManifestException
other
- the Manifest to be merged with this one.overwriteMain
- whether to overwrite the main section
of the current manifest
ManifestException
- if there is a problem merging the
manifest according to the Manifest spec.public void write(PrintWriter writer) throws IOException
writer
- the Writer to which the manifest is written
IOException
- if the manifest cannot be writtenpublic String toString()
toString
in class Object
public Enumeration getWarnings()
public int hashCode()
hashCode
in class Object
Object.hashCode()
public boolean equals(Object rhs)
equals
in class Object
Object.equals(java.lang.Object)
public String getManifestVersion()
public Manifest.Section getMainSection()
public Manifest.Section getSection(String name)
name
- the name of the section desired.
public Enumeration getSectionNames()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |