manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1438533 - in /manifoldcf/branches/release-1.1-branch: ./ CHANGES.txt connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/HttpPoster.java
Date Fri, 25 Jan 2013 14:21:11 GMT
Author: kwright
Date: Fri Jan 25 14:21:11 2013
New Revision: 1438533

URL: http://svn.apache.org/viewvc?rev=1438533&view=rev
Log:
Pull up fix for CONNECTORS-623 from trunk.

Modified:
    manifoldcf/branches/release-1.1-branch/   (props changed)
    manifoldcf/branches/release-1.1-branch/CHANGES.txt
    manifoldcf/branches/release-1.1-branch/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/HttpPoster.java

Propchange: manifoldcf/branches/release-1.1-branch/
------------------------------------------------------------------------------
  Merged /manifoldcf/trunk:r1438528-1438529

Modified: manifoldcf/branches/release-1.1-branch/CHANGES.txt
URL: http://svn.apache.org/viewvc/manifoldcf/branches/release-1.1-branch/CHANGES.txt?rev=1438533&r1=1438532&r2=1438533&view=diff
==============================================================================
--- manifoldcf/branches/release-1.1-branch/CHANGES.txt (original)
+++ manifoldcf/branches/release-1.1-branch/CHANGES.txt Fri Jan 25 14:21:11 2013
@@ -3,6 +3,9 @@ $Id$
 
 ======================= Release 1.1 =====================
 
+CONNECTORS-623: The stream_size and stream_name can be sent to Solr now.
+(Shinichiro Abe)
+
 CONNECTORS-622: CMIS Connector returns NPE trying to get an empty boolean or date value
 (Piergiorgio Lucidi)
 

Modified: manifoldcf/branches/release-1.1-branch/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/HttpPoster.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/release-1.1-branch/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/HttpPoster.java?rev=1438533&r1=1438532&r2=1438533&view=diff
==============================================================================
--- manifoldcf/branches/release-1.1-branch/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/HttpPoster.java
(original)
+++ manifoldcf/branches/release-1.1-branch/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/HttpPoster.java
Fri Jan 25 14:21:11 2013
@@ -749,6 +749,7 @@ public class HttpPoster
       long length = document.getBinaryLength();
       InputStream is = document.getBinaryStream();
       String contentType = document.getMimeType();
+      String contentName = document.getFileName();
 
       try
       {
@@ -792,14 +793,17 @@ public class HttpPoster
               writeField(out,LITERAL+newFieldName,values);
             }
           }
-                
+               
+          writeField(out,LITERAL+"stream_size",String.valueOf(length));
+          writeField(out,LITERAL+"stream_name",document.getFileName());
+          
           // Write the commitWithin parameter
           if (commitWithin != null)
             writeField(out,COMMITWITHIN_METADATA,commitWithin);
 
           contentStreamUpdateRequest.setParams(out);
           
-          contentStreamUpdateRequest.addContentStream(new RepositoryDocumentStream(is,length,contentType));
+          contentStreamUpdateRequest.addContentStream(new RepositoryDocumentStream(is,length,contentType,contentName));
 
           // Fire off the request.
           // Note: I need to know whether the document has been permanently rejected or not,
but we currently have
@@ -1116,12 +1120,14 @@ public class HttpPoster
     protected final InputStream is;
     protected final long length;
     protected final String contentType;
+    protected final String contentName;
     
-    public RepositoryDocumentStream(InputStream is, long length, String contentType)
+    public RepositoryDocumentStream(InputStream is, long length, String contentType, String
contentName)
     {
       this.is = is;
       this.length = length;
       this.contentType = contentType;
+      this.contentName = contentName;
     }
     
     @Override
@@ -1148,6 +1154,11 @@ public class HttpPoster
       return contentType;
     }
 
+    @Override
+    public String getName()
+    {
+      return contentName;
+    }
   }
 
   /** Special version of ping class where we can control the URL



Mime
View raw message