public final class MIMEStructureHandler extends java.lang.Object implements StructureHandler
MIMEStructureHandler - The handler to generate a JSON object reflecting a message's MIME structure.| Constructor and Description |
|---|
MIMEStructureHandler(long maxSize)
Initializes a new
MIMEStructureHandler. |
| Modifier and Type | Method and Description |
|---|---|
org.json.JSONObject |
getJSONMailObject()
Gets the JSON representation of mail's MIME structure.
|
boolean |
handleAttachment(MailPart part,
java.lang.String id) |
boolean |
handleColorLabel(int colorLabel) |
boolean |
handleEnd(MailMessage mail) |
boolean |
handleHeaders(java.util.Iterator<java.util.Map.Entry<java.lang.String,java.lang.String>> iter) |
boolean |
handleInlineUUEncodedAttachment(UUEncodedPart part,
java.lang.String id) |
boolean |
handleInlineUUEncodedPlainText(java.lang.String decodedTextContent,
ContentType contentType,
int size,
java.lang.String fileName,
java.lang.String id) |
boolean |
handleMultipartEnd() |
boolean |
handleMultipartStart(ContentType contentType,
int bodyPartCount,
java.lang.String id) |
boolean |
handleNestedMessage(MailPart mailPart,
java.lang.String id) |
boolean |
handleReceivedDate(java.util.Date receivedDate) |
boolean |
handleSMIMEBodyData(byte[] data) |
boolean |
handleSMIMEBodyText(MailPart part) |
boolean |
handleSystemFlags(int flags) |
boolean |
handleUserFlags(java.lang.String[] userFlags) |
MIMEStructureHandler |
setForceJSONArray4Multipart(boolean forceJSONArray4Multipart)
Sets whether a JSON array is enforced for a
multipart even if it only consists of one part. |
public MIMEStructureHandler(long maxSize)
MIMEStructureHandler.maxSize - The max. size of a mail part to let its content being inserted as base64 encoded or UTF-8 string.public MIMEStructureHandler setForceJSONArray4Multipart(boolean forceJSONArray4Multipart)
multipart even if it only consists of one part.forceJSONArray4Multipart - true to enforce a JSON array; otherwise falsepublic boolean handleEnd(MailMessage mail) throws com.openexchange.exception.OXException
handleEnd in interface StructureHandlercom.openexchange.exception.OXExceptionpublic org.json.JSONObject getJSONMailObject()
public boolean handleAttachment(MailPart part, java.lang.String id) throws com.openexchange.exception.OXException
handleAttachment in interface StructureHandlercom.openexchange.exception.OXExceptionpublic boolean handleSMIMEBodyText(MailPart part) throws com.openexchange.exception.OXException
handleSMIMEBodyText in interface StructureHandlercom.openexchange.exception.OXExceptionpublic boolean handleSMIMEBodyData(byte[] data)
throws com.openexchange.exception.OXException
handleSMIMEBodyData in interface StructureHandlercom.openexchange.exception.OXExceptionpublic boolean handleColorLabel(int colorLabel)
throws com.openexchange.exception.OXException
handleColorLabel in interface StructureHandlercom.openexchange.exception.OXExceptionpublic boolean handleHeaders(java.util.Iterator<java.util.Map.Entry<java.lang.String,java.lang.String>> iter)
throws com.openexchange.exception.OXException
handleHeaders in interface StructureHandlercom.openexchange.exception.OXExceptionpublic boolean handleInlineUUEncodedAttachment(UUEncodedPart part, java.lang.String id) throws com.openexchange.exception.OXException
handleInlineUUEncodedAttachment in interface StructureHandlercom.openexchange.exception.OXExceptionpublic boolean handleInlineUUEncodedPlainText(java.lang.String decodedTextContent,
ContentType contentType,
int size,
java.lang.String fileName,
java.lang.String id)
throws com.openexchange.exception.OXException
handleInlineUUEncodedPlainText in interface StructureHandlercom.openexchange.exception.OXExceptionpublic boolean handleMultipartStart(ContentType contentType, int bodyPartCount, java.lang.String id) throws com.openexchange.exception.OXException
handleMultipartStart in interface StructureHandlercom.openexchange.exception.OXExceptionpublic boolean handleMultipartEnd()
throws com.openexchange.exception.OXException
handleMultipartEnd in interface StructureHandlercom.openexchange.exception.OXExceptionpublic boolean handleNestedMessage(MailPart mailPart, java.lang.String id) throws com.openexchange.exception.OXException
handleNestedMessage in interface StructureHandlercom.openexchange.exception.OXExceptionpublic boolean handleReceivedDate(java.util.Date receivedDate)
throws com.openexchange.exception.OXException
handleReceivedDate in interface StructureHandlercom.openexchange.exception.OXExceptionpublic boolean handleSystemFlags(int flags)
throws com.openexchange.exception.OXException
handleSystemFlags in interface StructureHandlercom.openexchange.exception.OXExceptionpublic boolean handleUserFlags(java.lang.String[] userFlags)
throws com.openexchange.exception.OXException
handleUserFlags in interface StructureHandlercom.openexchange.exception.OXException