public class SplitAttachmentsExpression
extends org.apache.camel.support.ExpressionAdapter
Expression
which can be used to split a MailMessage
per attachment. For example if a mail message has 5 attachments, then this
expression will return a List<Message> that contains 5 Message
.
The message can be split 2 ways:
As an attachment | The message is split into cloned messages, each has only one attachment. The mail attachment in each message remains unprocessed. |
As a byte[] or String | The attachments are split into new messages as the body. This allows the split messages to be easily used by other processors / routes, as many other camel components can work on the byte[] or String, e.g. it can be written to disk using camel-file. |
Modifier and Type | Field and Description |
---|---|
static String |
HEADER_NAME |
Constructor and Description |
---|
SplitAttachmentsExpression() |
SplitAttachmentsExpression(boolean extractAttachments) |
Modifier and Type | Method and Description |
---|---|
Object |
evaluate(org.apache.camel.Exchange exchange) |
boolean |
isExtractAttachments() |
void |
setExtractAttachments(boolean extractAttachments) |
public static final String HEADER_NAME
public SplitAttachmentsExpression()
public SplitAttachmentsExpression(boolean extractAttachments)
public Object evaluate(org.apache.camel.Exchange exchange)
evaluate
in class org.apache.camel.support.ExpressionSupport
public boolean isExtractAttachments()
public void setExtractAttachments(boolean extractAttachments)
Apache Camel