Class ExtractMessageInformationAction
- java.lang.Object
-
- org.nuxeo.ecm.platform.mail.listener.action.AbstractMailAction
-
- org.nuxeo.ecm.platform.mail.listener.action.ExtractMessageInformationAction
-
- All Implemented Interfaces:
MessageAction
public class ExtractMessageInformationAction extends AbstractMailAction
Puts on the pipe execution context the values retrieved from the new messages found in the INBOX. These values are used later when new MailMessage documents are created based on them.- Author:
- Catalin Baican
-
-
Field Summary
Fields Modifier and Type Field Description static String
COPY_MESSAGE
static String
DEFAULT_BINARY_MIMETYPE
static String
MESSAGE_RFC822_MIMETYPE
-
Constructor Summary
Constructors Constructor Description ExtractMessageInformationAction()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static String
decodeMailBody(javax.mail.Part part)
Interprets the body accordingly to the charset used.boolean
execute(ExecutionContext context)
Executes one action.protected void
getAttachmentParts(javax.mail.Part part, String defaultFilename, MimetypeRegistry mimeService, ExecutionContext context)
protected static String
getFilename(javax.mail.Part p, String defaultFileName)
Collection<String>
getHeaderValues(javax.mail.Message message, String headerName)
-
Methods inherited from class org.nuxeo.ecm.platform.mail.listener.action.AbstractMailAction
getCoreSession, reset
-
-
-
-
Field Detail
-
DEFAULT_BINARY_MIMETYPE
public static final String DEFAULT_BINARY_MIMETYPE
- See Also:
- Constant Field Values
-
MESSAGE_RFC822_MIMETYPE
public static final String MESSAGE_RFC822_MIMETYPE
- See Also:
- Constant Field Values
-
COPY_MESSAGE
public static final String COPY_MESSAGE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ExtractMessageInformationAction
public ExtractMessageInformationAction()
-
-
Method Detail
-
execute
public boolean execute(ExecutionContext context)
Description copied from interface:MessageAction
Executes one action.If it returns false, the following actions from the pipe are not executed.
- Specified by:
execute
in interfaceMessageAction
- Overrides:
execute
in classAbstractMailAction
- See Also:
ExecutionContext
-
getFilename
protected static String getFilename(javax.mail.Part p, String defaultFileName) throws javax.mail.MessagingException
- Throws:
javax.mail.MessagingException
-
getAttachmentParts
protected void getAttachmentParts(javax.mail.Part part, String defaultFilename, MimetypeRegistry mimeService, ExecutionContext context) throws javax.mail.MessagingException, IOException
- Throws:
javax.mail.MessagingException
IOException
-
decodeMailBody
protected static String decodeMailBody(javax.mail.Part part) throws javax.mail.MessagingException, IOException
Interprets the body accordingly to the charset used. It relies on the content type being ****;charset={charset};******- Returns:
- the decoded String
- Throws:
javax.mail.MessagingException
IOException
-
getHeaderValues
public Collection<String> getHeaderValues(javax.mail.Message message, String headerName) throws javax.mail.MessagingException
- Throws:
javax.mail.MessagingException
-
-