CAMEL-6888 fixed the stream copy issue of JcloudsPayloadConverter

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

Branch: refs/heads/camel-2.12.x
Commit: 4e6bab3bb85221129f838ad6df77fc6f53c5885b
Parents: c4b3764
Author: Willem Jiang <ningji...@apache.org>
Authored: Wed Oct 23 21:20:00 2013 +0800
Committer: Willem Jiang <willem.ji...@gmail.com>
Committed: Wed Oct 23 22:33:55 2013 +0800

----------------------------------------------------------------------
 .../apache/camel/component/jclouds/JcloudsPayloadConverter.java    | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/4e6bab3b/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsPayloadConverter.java
----------------------------------------------------------------------
diff --git 
a/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsPayloadConverter.java
 
b/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsPayloadConverter.java
index 4f41197..11e904b 100644
--- 
a/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsPayloadConverter.java
+++ 
b/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsPayloadConverter.java
@@ -30,6 +30,7 @@ import org.apache.camel.component.file.GenericFile;
 import org.apache.camel.converter.stream.CachedOutputStream;
 import org.apache.camel.converter.stream.StreamSourceCache;
 import org.apache.camel.spi.TypeConverterRegistry;
+import org.apache.camel.util.IOHelper;
 import org.jclouds.io.Payload;
 import org.jclouds.io.payloads.ByteArrayPayload;
 import org.jclouds.io.payloads.FilePayload;
@@ -68,6 +69,7 @@ public final class JcloudsPayloadConverter {
             return payload;
         } else {
             CachedOutputStream cos = new CachedOutputStream(exchange);
+            IOHelper.copy(is, cos);
             return toPayload(cos.getWrappedInputStream(), exchange);
         }
     }

Reply via email to