org.apache.james.jdkim.impl
Class Message

java.lang.Object
  extended by org.apache.james.jdkim.impl.Message
All Implemented Interfaces:
Headers

public class Message
extends Object
implements Headers

The header of an entity (see RFC 2045).


Constructor Summary
Message()
          Creates a new empty Header.
Message(InputStream is)
          Creates a new Header from the specified stream.
 
Method Summary
 void addField(String fieldName, String field)
          Adds a field to the end of the list of fields.
 InputStream getBodyInputStream()
           
 List getFields()
          Gets the fields of this header.
 List getFields(String name)
          Gets all Fields having the specified field name in a case insensitive way.
 void setBodyInputStream(InputStream is)
           
 String toString()
          Return Header Object as String representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Message

public Message()
Creates a new empty Header.


Message

public Message(InputStream is)
        throws IOException,
               org.apache.james.mime4j.MimeException
Creates a new Header from the specified stream.

Parameters:
is - the stream to read the header from.
Throws:
IOException - on I/O errors.
MimeIOException - on MIME protocol violations.
org.apache.james.mime4j.MimeException
Method Detail

getBodyInputStream

public InputStream getBodyInputStream()

setBodyInputStream

public void setBodyInputStream(InputStream is)

addField

public void addField(String fieldName,
                     String field)
Adds a field to the end of the list of fields.

Parameters:
field - the field to add.

getFields

public List getFields()
Description copied from interface: Headers
Gets the fields of this header. The returned list will not be modifiable.

Specified by:
getFields in interface Headers
Returns:
the list of Field objects.
See Also:
Headers.getFields()

getFields

public List getFields(String name)
Description copied from interface: Headers
Gets all Fields having the specified field name in a case insensitive way.

Specified by:
getFields in interface Headers
Parameters:
name - the field name (e.g. From, Subject).
Returns:
the list of fields.
See Also:
Headers.getFields(java.lang.String)

toString

public String toString()
Return Header Object as String representation. Each headerline is seperated by "\r\n"

Overrides:
toString in class Object
Returns:
headers


Copyright © 2008-2009 The Apache Software Foundation. All Rights Reserved.