Class SplitAttachmentsExpression

java.lang.Object
org.apache.camel.support.ExpressionSupport
org.apache.camel.support.ExpressionAdapter
org.apache.camel.component.mail.SplitAttachmentsExpression
All Implemented Interfaces:
org.apache.camel.Expression, org.apache.camel.Predicate

public class SplitAttachmentsExpression extends org.apache.camel.support.ExpressionAdapter
A 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 is split:
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.
In both cases the attachment name is written to a the camel header "CamelSplitAttachmentId"
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    evaluate(org.apache.camel.Exchange exchange)
     

    Methods inherited from class org.apache.camel.support.ExpressionAdapter

    assertionFailureMessage, evaluate, init

    Methods inherited from class org.apache.camel.support.ExpressionSupport

    assertMatches, matches

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.camel.Predicate

    initPredicate
  • Field Details

  • Constructor Details

    • SplitAttachmentsExpression

      public SplitAttachmentsExpression()
  • Method Details

    • evaluate

      public Object evaluate(org.apache.camel.Exchange exchange)
      Overrides:
      evaluate in class org.apache.camel.support.ExpressionSupport