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:47 UTC
[7/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/7c6b566a
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/7c6b566a
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/7c6b566a
Branch: refs/heads/camel-2.10.x
Commit: 7c6b566abee9d5689e2f32a2ba1355cd9d18f06e
Parents: c48f067
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:53 2013 +0200
----------------------------------------------------------------------
.../apache/camel/component/file/GenericFileMessage.java | 11 +++++++++++
1 file changed, 11 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/7c6b566a/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;