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 2013/07/17 13:39:45 UTC
[5/8] git commit: CAMEL-6505: GenericFileMessage fixed copyFrom to
copy the generic file also.
CAMEL-6505: GenericFileMessage fixed copyFrom to copy the generic file also.
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/31a27b19
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/31a27b19
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/31a27b19
Branch: refs/heads/camel-2.11.x
Commit: 31a27b19deb084a7ef5114b57968fe69308598c4
Parents: c66e94c
Author: Claus Ibsen <da...@apache.org>
Authored: Wed Jul 17 12:04:39 2013 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Wed Jul 17 13:34:31 2013 +0200
----------------------------------------------------------------------
.../apache/camel/component/file/GenericFileMessage.java | 11 +++++++++++
1 file changed, 11 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/31a27b19/camel-core/src/main/java/org/apache/camel/component/file/GenericFileMessage.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/file/GenericFileMessage.java b/camel-core/src/main/java/org/apache/camel/component/file/GenericFileMessage.java
index bcf1e1a..206d928 100644
--- a/camel-core/src/main/java/org/apache/camel/component/file/GenericFileMessage.java
+++ b/camel-core/src/main/java/org/apache/camel/component/file/GenericFileMessage.java
@@ -16,6 +16,7 @@
*/
package org.apache.camel.component.file;
+import org.apache.camel.Message;
import org.apache.camel.impl.DefaultMessage;
/**
@@ -50,6 +51,16 @@ public class GenericFileMessage<T> extends DefaultMessage {
}
@Override
+ @SuppressWarnings("unchecked")
+ public void copyFrom(Message that) {
+ super.copyFrom(that);
+
+ if (that instanceof GenericFileMessage) {
+ setGenericFile(((GenericFileMessage) that).getGenericFile());
+ }
+ }
+
+ @Override
public String toString() {
// only output the filename as body can be big
return file != null ? file.getFileName() : null;