FileDocCategorySizeDatePackage
AddFooter.javaAPI DocApache James 2.3.13027Fri Jan 12 12:56:28 GMT 2007org.apache.james.transport.mailets

AddFooter

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

Fields Summary
String
text
This is the plain text version of the footer we are going to add
Constructors Summary
Methods Summary
public java.lang.StringgetFooterHTML()
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.

return
the HTML version of the footer text

        String text = getFooterText();
        StringBuffer sb = new StringBuffer();
        StringTokenizer st = new StringTokenizer(text, "\r\n", true);
        while (st.hasMoreTokens()) {
            String token = st.nextToken();
            if (token.equals("\r")) {
                continue;
            }
            if (token.equals("\n")) {
                sb.append("<br />\n");
            } else {
                sb.append(token);
            }
        }
        return sb.toString();
    
public java.lang.StringgetFooterText()
This is exposed as a method for easy subclassing to provide alternate ways to get the footer text.

return
the footer text

        return text;
    
public java.lang.StringgetMailetInfo()
Return a string describing this mailet.

return
a string describing this mailet

        return "AddFooter Mailet";
    
public voidinit()
Initialize the mailet

    
            
         
        text = getInitParameter("text");