org.apache.tools.ant.taskdefs
Class Manifest

java.lang.Object
  |
  +--org.apache.tools.ant.taskdefs.Manifest

public class Manifest
extends java.lang.Object

Class to manage Manifest information

Author:
Conor MacNeill

Inner Class Summary
static class Manifest.Attribute
          Class to hold manifest attributes
static class Manifest.Section
          Class to represent an individual section in the Manifest.
 
Field Summary
static java.lang.String ATTRIBUTE_FROM
          THe From Header is disallowed in a Manifest
static java.lang.String ATTRIBUTE_MANIFEST_VERSION
          The standard manifest version header
static java.lang.String ATTRIBUTE_NAME
          The Name Attribute is the first in a named section
static java.lang.String ATTRIBUTE_SIGNATURE_VERSION
          The standard Signature Version header
static java.lang.String DEFAULT_MANIFEST_VERSION
          Default Manifest version if one is not specified
static int MAX_LINE_LENGTH
          The max length of a line in a Manifest
 
Constructor Summary
Manifest()
          Construct an empty manifest
Manifest(java.io.InputStream is)
          Read a manifest file from the given input stream
 
Method Summary
 void addConfiguredAttribute(Manifest.Attribute attribute)
           
 void addConfiguredSection(Manifest.Section section)
           
 boolean equals(java.lang.Object rhs)
           
 java.util.Enumeration getWarnings()
          Get the warnings for this manifest.
 void merge(Manifest other)
          Merge the contents of the given manifest into this manifest
 java.lang.String toString()
          Convert the manifest to its string representation
 void write(java.io.PrintWriter writer)
          Write the manifest out to a print writer.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ATTRIBUTE_MANIFEST_VERSION

public static final java.lang.String ATTRIBUTE_MANIFEST_VERSION
The standard manifest version header

ATTRIBUTE_SIGNATURE_VERSION

public static final java.lang.String ATTRIBUTE_SIGNATURE_VERSION
The standard Signature Version header

ATTRIBUTE_NAME

public static final java.lang.String ATTRIBUTE_NAME
The Name Attribute is the first in a named section

ATTRIBUTE_FROM

public static final java.lang.String ATTRIBUTE_FROM
THe From Header is disallowed in a Manifest

DEFAULT_MANIFEST_VERSION

public static final java.lang.String DEFAULT_MANIFEST_VERSION
Default Manifest version if one is not specified

MAX_LINE_LENGTH

public static final int MAX_LINE_LENGTH
The max length of a line in a Manifest
Constructor Detail

Manifest

public Manifest()
Construct an empty manifest

Manifest

public Manifest(java.io.InputStream is)
         throws ManifestException,
                java.io.IOException
Read a manifest file from the given input stream
Parameters:
is - the input stream from which the Manifest is read
Throws:
ManifestException - if the manifest is not valid according to the JAR spec
java.io.IOException - if the manifest cannot be read from the reader.
Method Detail

addConfiguredSection

public void addConfiguredSection(Manifest.Section section)
                          throws ManifestException

addConfiguredAttribute

public void addConfiguredAttribute(Manifest.Attribute attribute)
                            throws ManifestException

merge

public void merge(Manifest other)
           throws ManifestException
Merge the contents of the given manifest into this manifest
Parameters:
other - the Manifest to be merged with this one.
Throws:
ManifestException - if there is a problem merging the manfest according to the Manifest spec.

write

public void write(java.io.PrintWriter writer)
           throws java.io.IOException
Write the manifest out to a print writer.
Parameters:
writer - the Writer to which the manifest is written
Throws:
java.io.IOException - if the manifest cannot be written

toString

public java.lang.String toString()
Convert the manifest to its string representation
Overrides:
toString in class java.lang.Object
Returns:
a multiline string with the Manifest as it appears in a Manifest file.

getWarnings

public java.util.Enumeration getWarnings()
Get the warnings for this manifest.
Returns:
an enumeration of warning strings

equals

public boolean equals(java.lang.Object rhs)
Overrides:
equals in class java.lang.Object


Copyright © 1999-2002 Apache Software Foundation. All Rights Reserved.