org.apache.james.core
Class MailHeaders

java.lang.Object
  |
  +--javax.mail.internet.InternetHeaders
        |
        +--org.apache.james.core.MailHeaders
All Implemented Interfaces:
Cloneable, Serializable

public class MailHeaders
extends InternetHeaders
implements Serializable, Cloneable

This interface defines a container for mail headers. Each header must use MIME format:

name: value
.

Author:
Federico Barbieri
See Also:
Serialized Form

Constructor Summary
MailHeaders()
          No argument constructor
MailHeaders(InputStream in)
          Constructor that takes an InputStream containing the contents of the set of mail headers.
 
Method Summary
 boolean isSet(String name)
          Check if a particular header is present.
 boolean isValid()
          Check if all REQUIRED headers fields as specified in RFC 822 are present.
 byte[] toByteArray()
          Generate a representation of the headers as a series of bytes.
 void writeTo(OutputStream out)
          Write the headers to an output stream
 void writeTo(PrintStream writer)
          Write the headers to an PrintStream
 
Methods inherited from class javax.mail.internet.InternetHeaders
addHeader, addHeaderLine, getAllHeaderLines, getAllHeaders, getHeader, getHeader, getMatchingHeaderLines, getMatchingHeaders, getNonMatchingHeaderLines, getNonMatchingHeaders, load, removeHeader, setHeader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MailHeaders

public MailHeaders()
            throws MessagingException
No argument constructor

Throws:
MessagingException - if the super class cannot be properly instantiated

MailHeaders

public MailHeaders(InputStream in)
            throws MessagingException
Constructor that takes an InputStream containing the contents of the set of mail headers.

Parameters:
in - the InputStream containing the header data
Throws:
MessagingException - if the super class cannot be properly instantiated based on the stream
Method Detail

writeTo

public void writeTo(PrintStream writer)
Write the headers to an PrintStream

Parameters:
writer - the stream to which to write the headers

writeTo

public void writeTo(OutputStream out)
Write the headers to an output stream

Parameters:
out - the stream to which to write the headers

toByteArray

public byte[] toByteArray()
Generate a representation of the headers as a series of bytes.

Returns:
the byte array containing the headers

isSet

public boolean isSet(String name)
Check if a particular header is present.

Returns:
true if the header is present, false otherwise

isValid

public boolean isValid()
Check if all REQUIRED headers fields as specified in RFC 822 are present.

Returns:
true if the headers are present, false otherwise


"Copyright © 1999-2002 Apache Jakarta Project. All Rights Reserved."