|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.openexchange.mail.parser.MailMessageParser
public final class MailMessageParser
MailMessageParser - A callback parser to parse instances of MailMessage by invoking the handleXXX() methods
of given MailMessageHandler object
| Constructor Summary | |
|---|---|
MailMessageParser()
Constructor |
|
| Method Summary | |
|---|---|
static java.lang.String |
generateFilename(java.lang.String sequenceId,
java.lang.String baseMimeType)
Generates a filename consisting of common prefix "Part_" and part's sequence ID appended |
static java.lang.String |
getFileName(java.lang.String rawFileName,
java.lang.String sequenceId,
java.lang.String baseMimeType)
Generates an appropriate filename from either specified rawFileName if not null or generates a filename
composed with "Part_" + sequenceId |
static java.lang.String |
getSequenceId(java.lang.String prefix,
int partCount)
Composes part's sequence ID from given prefix and part's count |
java.util.List<com.openexchange.groupware.AbstractOXException> |
getWarnings()
Gets possible warnings occurred during parsing. |
void |
parseMailMessage(MailMessage mail,
MailMessageHandler handler)
Parses specified mail using given handler as call-back |
void |
parseMailMessage(MailMessage mail,
MailMessageHandler handler,
java.lang.String prefix)
Parses specified mail using given handler as call-back and given initial prefix for mail part identifiers; e.g. |
MailMessageParser |
reset()
Resets this parser and returns itself |
MailMessageParser |
setInlineDetectorBehavior(boolean strict)
Switches the INLINE detector behavior. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MailMessageParser()
| Method Detail |
|---|
public MailMessageParser setInlineDetectorBehavior(boolean strict)
strict - true to perform strict INLINE detector behavior; otherwise false
public java.util.List<com.openexchange.groupware.AbstractOXException> getWarnings()
public MailMessageParser reset()
public void parseMailMessage(MailMessage mail,
MailMessageHandler handler)
throws MailException
mail - The mail to parsehandler - The call-back handler
MailException - If parsing specified mail fails
public void parseMailMessage(MailMessage mail,
MailMessageHandler handler,
java.lang.String prefix)
throws MailException
"1.1".
mail - The mail to parsehandler - The call-back handlerprefix - The initial prefix for mail part identifiers; e.g. "1.1"
MailException - If parsing specified mail fails
public static java.lang.String getFileName(java.lang.String rawFileName,
java.lang.String sequenceId,
java.lang.String baseMimeType)
rawFileName if not null or generates a filename
composed with "Part_" + sequenceId
rawFileName - The raw filename obtained from mail partsequenceId - The part's sequence IDbaseMimeType - The base MIME type to look up an appropriate file extension, if rawFileName is null
public static java.lang.String getSequenceId(java.lang.String prefix,
int partCount)
prefix - The prefix (may be null)partCount - The part count
public static java.lang.String generateFilename(java.lang.String sequenceId,
java.lang.String baseMimeType)
sequenceId - Part's sequence IDbaseMimeType - The base MIME type to look up an appropriate file extension if rawFileName is null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||