org.apache.james.transport.mailets
Class AddFooter

java.lang.Object
  |
  +--org.apache.mailet.GenericMailet
        |
        +--org.apache.james.transport.mailets.AddFooter
All Implemented Interfaces:
Mailet, MailetConfig

public class AddFooter
extends GenericMailet

This mailet will attach text to the end of the message (like a footer). Right now it only supports simple messages without multiple parts.


Constructor Summary
AddFooter()
           
 
Method Summary
protected  void addToHTML(MimePart part)
          Prepends the content of the MimePart as HTML to the existing footer
protected  void addToText(MimePart part)
          Prepends the content of the MimePart as text to the existing footer
protected  void attachFooter(MimePart part)
          Attaches a MimePart as an appropriate footer
 String getFooterHTML()
          This is exposed as a method for easy subclassing to provide alternate ways to get the footer text.
 String getFooterText()
          This is exposed as a method for easy subclassing to provide alternate ways to get the footer text.
 String getMailetInfo()
          Return a string describing this mailet.
 void init()
          Initialize the mailet
 void service(Mail mail)
          Takes the message and attaches a footer message to it.
 
Methods inherited from class org.apache.mailet.GenericMailet
destroy, getInitParameter, getInitParameterNames, getMailetConfig, getMailetContext, getMailetName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AddFooter

public AddFooter()
Method Detail

init

public void init()
          throws MessagingException
Initialize the mailet

Overrides:
init in class GenericMailet
Throws:
MessagingException - if an exception occurs that interrupts the mailet's normal operation

service

public void service(Mail mail)
             throws MessagingException
Takes the message and attaches a footer message to it. Right now, it only supports simple messages. Needs to have additions to make it support messages with alternate content types or with attachments.

Specified by:
service in interface Mailet
Specified by:
service in class GenericMailet
Parameters:
mail - the mail being processed
Throws:
MessagingException - if an error arises during message processing

getFooterText

public String getFooterText()
This is exposed as a method for easy subclassing to provide alternate ways to get the footer text.

Returns:
the footer text

getFooterHTML

public String getFooterHTML()
This is exposed as a method for easy subclassing to provide alternate ways to get the footer text. By default, this will take the footer text, converting the linefeeds to <br> tags.

Returns:
the HTML version of the footer text

getMailetInfo

public String getMailetInfo()
Return a string describing this mailet.

Specified by:
getMailetInfo in interface Mailet
Overrides:
getMailetInfo in class GenericMailet
Returns:
a string describing this mailet

addToText

protected void addToText(MimePart part)
                  throws MessagingException,
                         IOException
Prepends the content of the MimePart as text to the existing footer

Parameters:
part - the MimePart to attach
Throws:
MessagingException
IOException

addToHTML

protected void addToHTML(MimePart part)
                  throws MessagingException,
                         IOException
Prepends the content of the MimePart as HTML to the existing footer

Parameters:
part - the MimePart to attach
Throws:
MessagingException
IOException

attachFooter

protected void attachFooter(MimePart part)
                     throws MessagingException,
                            IOException
Attaches a MimePart as an appropriate footer

Parameters:
part - the MimePart to attach
Throws:
MessagingException
IOException


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