|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.jar.Manifest
org.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.BaseAttribute
|
class |
Manifest.ExistingAttribute
|
class |
Manifest.ExistingSection
|
static class |
Manifest.Section
A manifest section - you can nest attribute elements into sections. |
Constructor Summary | |
---|---|
Manifest()
Construct an empty manifest |
|
Manifest(InputStream is)
|
|
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 |
static Manifest |
getDefaultManifest()
Construct a manifest from Ant's default manifest file. |
Manifest.ExistingSection |
getMainSection()
Get the main section of the manifest |
String |
getManifestVersion()
Get the version of the manifest |
Manifest.ExistingSection |
getSection(String name)
Get a particular section from the manifest |
Iterator<String> |
iterator()
|
static String |
remap(Attributes backingAttributes,
Manifest.Attribute attribute)
|
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.util.jar.Manifest |
---|
clear, clone, equals, getAttributes, getEntries, getMainAttributes, hashCode, read, write |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
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.public Manifest(InputStream is) throws IOException
IOException
Method Detail |
---|
public Iterator<String> iterator()
iterator
in interface Iterable<String>
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 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 String getManifestVersion()
public Manifest.ExistingSection getMainSection()
public Manifest.ExistingSection getSection(String name)
name
- the name of the section desired.
public static String remap(Attributes backingAttributes, Manifest.Attribute attribute) throws ManifestException
ManifestException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |