public class Manifest extends Manifest implements Iterable<String>
Modifier and Type | Class and 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 and Description |
---|
Manifest()
Construct an empty manifest
|
Manifest(InputStream is) |
Manifest(Reader r)
Read a manifest file from the given reader
|
Modifier and Type | Method and 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
|
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.
|
clear, clone, equals, getAttributes, getEntries, getMainAttributes, hashCode, read, write
public Manifest()
public Manifest(Reader r) throws ManifestException, IOException
r
- is the reader from which the Manifest is readManifestException
- if the manifest is not valid according
to the JAR specIOException
- if the manifest cannot be read from the reader.public Manifest(InputStream is) throws IOException
IOException
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(PrintWriter writer) throws IOException
writer
- the Writer to which the manifest is writtenIOException
- if the manifest cannot be writtenpublic String toString()
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
Copyright © 2001-2012 Codehaus. All Rights Reserved.