servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lh...@apache.org
Subject svn commit: r642243 - /servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/BinaryFileMarshaler.java
Date Fri, 28 Mar 2008 14:37:44 GMT
Author: lhein
Date: Fri Mar 28 07:37:39 2008
New Revision: 642243

URL: http://svn.apache.org/viewvc?rev=642243&view=rev
Log:
- reverted the usage of FileDataSource (see SM-1295) because it breaks the FTP polling logic

Modified:
    servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/BinaryFileMarshaler.java

Modified: servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/BinaryFileMarshaler.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/BinaryFileMarshaler.java?rev=642243&r1=642242&r2=642243&view=diff
==============================================================================
--- servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/BinaryFileMarshaler.java
(original)
+++ servicemix/smx3/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/components/util/BinaryFileMarshaler.java
Fri Mar 28 07:37:39 2008
@@ -22,14 +22,13 @@
 import java.io.OutputStream;
 
 import javax.activation.DataHandler;
-import javax.activation.DataSource;
-import javax.activation.FileDataSource;
 import javax.jbi.JBIException;
 import javax.jbi.messaging.MessageExchange;
 import javax.jbi.messaging.MessagingException;
 import javax.jbi.messaging.NormalizedMessage;
 
 import org.apache.servicemix.jbi.util.FileUtil;
+import org.apache.servicemix.jbi.util.StreamDataSource;
 
 /**
  * A FileMarshaler that converts the given input stream into a binary
@@ -84,8 +83,7 @@
     public void readMessage(MessageExchange exchange, NormalizedMessage message, InputStream
in, String path)
         throws IOException, JBIException {
         File polledFile = new File(path);
-        DataSource ds = new FileDataSource(polledFile);
-        DataHandler handler = new DataHandler(ds);
+        DataHandler handler = new DataHandler(new StreamDataSource(in));
         message.addAttachment(attachment, handler);
         message.setProperty(FILE_NAME_PROPERTY, polledFile.getName());
         message.setProperty(FILE_PATH_PROPERTY, path);



Mime
View raw message