camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bibr...@apache.org
Subject svn commit: r1328722 - /camel/trunk/components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrProducer.java
Date Sat, 21 Apr 2012 18:42:09 GMT
Author: bibryam
Date: Sat Apr 21 18:42:08 2012
New Revision: 1328722

URL: http://svn.apache.org/viewvc?rev=1328722&view=rev
Log:
When body is a WrappedFile, get the file from it

Modified:
    camel/trunk/components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrProducer.java

Modified: camel/trunk/components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrProducer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrProducer.java?rev=1328722&r1=1328721&r2=1328722&view=diff
==============================================================================
--- camel/trunk/components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrProducer.java
(original)
+++ camel/trunk/components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrProducer.java
Sat Apr 21 18:42:08 2012
@@ -19,6 +19,7 @@ package org.apache.camel.component.solr;
 import java.io.File;
 import java.util.Map;
 import org.apache.camel.Exchange;
+import org.apache.camel.WrappedFile;
 import org.apache.camel.impl.DefaultProducer;
 import org.apache.solr.client.solrj.SolrServer;
 import org.apache.solr.client.solrj.request.ContentStreamUpdateRequest;
@@ -73,6 +74,9 @@ public class SolrProducer extends Defaul
     private void insert(Exchange exchange, boolean isStreaming) throws Exception {
 
         Object body = exchange.getIn().getBody();
+        if (body instanceof WrappedFile) {
+            body = ((WrappedFile)body).getFile();
+        }
 
         if (body instanceof File) {
 



Mime
View raw message