java.lang.Iterable<java.lang.String>public class Manifest
extends java.util.jar.Manifest
implements java.lang.Iterable<java.lang.String>
| Modifier and Type | Class | Description |
|---|---|---|
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 | Description |
|---|---|
Manifest() |
Construct an empty manifest
|
Manifest(java.io.InputStream is) |
|
Manifest(java.io.Reader r) |
Deprecated.
This constructor does not properly map characters to bytes. Use
Manifest(InputStream). Will be removed in 4.0. |
| Modifier and Type | Method | Description |
|---|---|---|
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
|
java.lang.String |
getManifestVersion() |
Get the version of the manifest
|
Manifest.ExistingSection |
getSection(java.lang.String name) |
Get a particular section from the manifest
|
java.util.Iterator<java.lang.String> |
iterator() |
|
static java.lang.String |
remap(java.util.jar.Attributes backingAttributes,
Manifest.Attribute attribute) |
|
java.lang.String |
toString() |
Convert the manifest to its string representation
|
void |
write(java.io.Writer writer) |
Writes the manifest out to a writer.
|
public Manifest()
@Deprecated
public Manifest(java.io.Reader r)
throws ManifestException,
java.io.IOException
Manifest(InputStream). Will be removed in 4.0.r - is the reader from which the Manifest is readManifestException - if the manifest is not valid according
to the JAR specjava.io.IOException - if the manifest cannot be read from the reader.public Manifest(java.io.InputStream is)
throws java.io.IOException
java.io.IOExceptionpublic java.util.Iterator<java.lang.String> iterator()
iterator in interface java.lang.Iterable<java.lang.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 addedManifestException - 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(java.io.Writer writer)
throws java.io.IOException
writer - the Writer to which the manifest is writtenjava.io.IOException - if the manifest cannot be writtenpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getManifestVersion()
public Manifest.ExistingSection getMainSection()
public Manifest.ExistingSection getSection(java.lang.String name)
name - the name of the section desired.public static java.lang.String remap(java.util.jar.Attributes backingAttributes,
Manifest.Attribute attribute)
throws ManifestException
ManifestException