org.apache.mailet.base
Class FlowedMessageUtils

java.lang.Object
  extended by org.apache.mailet.base.FlowedMessageUtils

public final class FlowedMessageUtils
extends Object

Manages texts encoded as text/plain; format=flowed.

As a reference see:

Note


Field Summary
static String RFC2646_CRLF
           
static String RFC2646_FROM
           
static char RFC2646_QUOTE
           
static String RFC2646_SIGNATURE
           
static char RFC2646_SPACE
           
static int RFC2646_WIDTH
           
 
Method Summary
static String deflow(javax.mail.Message m)
          Obtains the content of the encoded message, if previously encoded as format=flowed.
static String deflow(String text, boolean delSp)
          Decodes a text previously wrapped using "format=flowed".
static void deflowMessage(javax.mail.Message m)
          If the message is format=flowed set the encoded version as message content.
static String flow(String text, boolean delSp)
          Encodes a text (using standard with).
static String flow(String text, boolean delSp, int width)
          Decodes a text.
static void flowMessage(javax.mail.Message m, boolean delSp)
          Encodes the message content (if text/plain).
static void flowMessage(javax.mail.Message m, boolean delSp, int width)
          Encodes the message content (if text/plain).
static boolean isAlphaChar(String text, int index)
          Checks whether the char is part of a word.
static boolean isFlowedTextMessage(javax.mail.Message m)
          Checks whether the input message is format=flowed.
static void setFlowedContent(javax.mail.Message m, String text, boolean delSp)
          Encodes the input text and sets it as the new message content.
static void setFlowedContent(javax.mail.Message m, String text, boolean delSp, int width, boolean preserveCharset, String charset)
          Encodes the input text and sets it as the new message content.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RFC2646_SPACE

public static final char RFC2646_SPACE
See Also:
Constant Field Values

RFC2646_QUOTE

public static final char RFC2646_QUOTE
See Also:
Constant Field Values

RFC2646_SIGNATURE

public static final String RFC2646_SIGNATURE
See Also:
Constant Field Values

RFC2646_CRLF

public static final String RFC2646_CRLF
See Also:
Constant Field Values

RFC2646_FROM

public static final String RFC2646_FROM
See Also:
Constant Field Values

RFC2646_WIDTH

public static final int RFC2646_WIDTH
See Also:
Constant Field Values
Method Detail

deflow

public static String deflow(String text,
                            boolean delSp)
Decodes a text previously wrapped using "format=flowed".


deflow

public static String deflow(javax.mail.Message m)
                     throws IOException,
                            javax.mail.MessagingException
Obtains the content of the encoded message, if previously encoded as format=flowed.

Throws:
IOException
javax.mail.MessagingException

deflowMessage

public static void deflowMessage(javax.mail.Message m)
                          throws javax.mail.MessagingException,
                                 IOException
If the message is format=flowed set the encoded version as message content.

Throws:
javax.mail.MessagingException
IOException

flow

public static String flow(String text,
                          boolean delSp)
Encodes a text (using standard with).


flow

public static String flow(String text,
                          boolean delSp,
                          int width)
Decodes a text.


setFlowedContent

public static void setFlowedContent(javax.mail.Message m,
                                    String text,
                                    boolean delSp)
                             throws javax.mail.MessagingException
Encodes the input text and sets it as the new message content.

Throws:
javax.mail.MessagingException

setFlowedContent

public static void setFlowedContent(javax.mail.Message m,
                                    String text,
                                    boolean delSp,
                                    int width,
                                    boolean preserveCharset,
                                    String charset)
                             throws javax.mail.MessagingException
Encodes the input text and sets it as the new message content.

Throws:
javax.mail.MessagingException

flowMessage

public static void flowMessage(javax.mail.Message m,
                               boolean delSp)
                        throws javax.mail.MessagingException,
                               IOException
Encodes the message content (if text/plain).

Throws:
javax.mail.MessagingException
IOException

flowMessage

public static void flowMessage(javax.mail.Message m,
                               boolean delSp,
                               int width)
                        throws javax.mail.MessagingException,
                               IOException
Encodes the message content (if text/plain).

Throws:
javax.mail.MessagingException
IOException

isAlphaChar

public static boolean isAlphaChar(String text,
                                  int index)
Checks whether the char is part of a word.

RFC assert a word cannot be splitted (even if the length is greater than the maximum length).


isFlowedTextMessage

public static boolean isFlowedTextMessage(javax.mail.Message m)
                                   throws javax.mail.MessagingException
Checks whether the input message is format=flowed.

Throws:
javax.mail.MessagingException


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