You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2014/11/21 15:47:37 UTC

[1/2] camel git commit: CAMEL-8068: camel-mail split attachments sets a header with the attachment key. Thanks to Christoph Laubrich for the patch.

Repository: camel
Updated Branches:
  refs/heads/camel-2.14.x cb590189a -> bd054c344
  refs/heads/master 97222de0b -> e5bab46e1


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/e5bab46e
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/e5bab46e
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/e5bab46e

Branch: refs/heads/master
Commit: e5bab46e1cc683a53c7fc9659979ddf0374eff39
Parents: 97222de
Author: Claus Ibsen <da...@apache.org>
Authored: Fri Nov 21 15:46:56 2014 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Fri Nov 21 15:46:56 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/e5bab46e/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);
         }
 


[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.

Posted by da...@apache.org.
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 <da...@apache.org>
Authored: Fri Nov 21 15:46:56 2014 +0100
Committer: Claus Ibsen <da...@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);
         }