camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [2/2] camel git commit: CAMEL-8068: camel-mail split attachments sets a header with the attachment key. Thanks to Christoph Laubrich for the patch.
Date Fri, 21 Nov 2014 14:47:38 GMT
CAMEL-8068: camel-mail split attachments sets a header with the attachment key. Thanks to Christoph
Laubrich for the patch.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/bd054c34
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/bd054c34
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/bd054c34

Branch: refs/heads/camel-2.14.x
Commit: bd054c344bc9608f53b0ca7f5c62a37239e93e3f
Parents: cb59018
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Fri Nov 21 15:46:56 2014 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Fri Nov 21 15:47:17 2014 +0100

----------------------------------------------------------------------
 .../camel/component/mail/SplitAttachmentsExpression.java      | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/bd054c34/components/camel-mail/src/main/java/org/apache/camel/component/mail/SplitAttachmentsExpression.java
----------------------------------------------------------------------
diff --git a/components/camel-mail/src/main/java/org/apache/camel/component/mail/SplitAttachmentsExpression.java
b/components/camel-mail/src/main/java/org/apache/camel/component/mail/SplitAttachmentsExpression.java
index 024e277..9ad24ed 100644
--- a/components/camel-mail/src/main/java/org/apache/camel/component/mail/SplitAttachmentsExpression.java
+++ b/components/camel-mail/src/main/java/org/apache/camel/component/mail/SplitAttachmentsExpression.java
@@ -45,8 +45,11 @@ public class SplitAttachmentsExpression extends ExpressionAdapter {
 
         for (Map.Entry<String, DataHandler> entry : exchange.getIn().getAttachments().entrySet())
{
             final Message copy = exchange.getIn().copy();
-            copy.getAttachments().clear();
-            copy.getAttachments().put(entry.getKey(), entry.getValue());
+            final String key = entry.getKey();
+            Map<String, DataHandler> attachments = copy.getAttachments();
+            attachments.clear();
+            attachments.put(key, entry.getValue());
+            copy.setHeader("CamelSplitAttachmentId", key);
             answer.add(copy);
         }
 


Mime
View raw message