manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1434659 - in /manifoldcf/branches/release-1.1-branch: ./ connectors/rss/ connectors/rss/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/rss/ connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/...
Date Thu, 17 Jan 2013 13:11:21 GMT
Author: kwright
Date: Thu Jan 17 13:11:21 2013
New Revision: 1434659

URL: http://svn.apache.org/viewvc?rev=1434659&view=rev
Log:
Pull up first part of CONNECTORS-613 fix.

Modified:
    manifoldcf/branches/release-1.1-branch/   (props changed)
    manifoldcf/branches/release-1.1-branch/connectors/rss/   (props changed)
    manifoldcf/branches/release-1.1-branch/connectors/rss/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/rss/RSSConnector.java
    manifoldcf/branches/release-1.1-branch/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/HttpPoster.java
    manifoldcf/branches/release-1.1-branch/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/WebcrawlerConnector.java
    manifoldcf/branches/release-1.1-branch/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/RepositoryDocument.java

Propchange: manifoldcf/branches/release-1.1-branch/
------------------------------------------------------------------------------
  Merged /manifoldcf/trunk:r1434653

Propchange: manifoldcf/branches/release-1.1-branch/connectors/rss/
------------------------------------------------------------------------------
  Merged /manifoldcf/trunk/connectors/rss:r1434653

Modified: manifoldcf/branches/release-1.1-branch/connectors/rss/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/rss/RSSConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/release-1.1-branch/connectors/rss/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/rss/RSSConnector.java?rev=1434659&r1=1434658&r2=1434659&view=diff
==============================================================================
--- manifoldcf/branches/release-1.1-branch/connectors/rss/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/rss/RSSConnector.java
(original)
+++ manifoldcf/branches/release-1.1-branch/connectors/rss/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/rss/RSSConnector.java
Thu Jan 17 13:11:21 2013
@@ -1355,6 +1355,9 @@ public class RSSConnector extends org.ap
             long dataSize = cache.getDataLength(urlValue);
             RepositoryDocument rd = new RepositoryDocument();
 
+            // Set content type
+            rd.setMimeType(cache.getContentType(urlValue));
+
             // Turn into acls and add into description
             String[] aclArray = new String[acls.size()];
             int j = 0;

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=1434659&r1=1434658&r2=1434659&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
Thu Jan 17 13:11:21 2013
@@ -736,6 +736,7 @@ public class HttpPoster
     {
       long length = document.getBinaryLength();
       InputStream is = document.getBinaryStream();
+      String contentType = document.getMimeType();
 
       try
       {
@@ -786,7 +787,7 @@ public class HttpPoster
 
           contentStreamUpdateRequest.setParams(out);
           
-          contentStreamUpdateRequest.addContentStream(new RepositoryDocumentStream(is,length));
+          contentStreamUpdateRequest.addContentStream(new RepositoryDocumentStream(is,length,contentType));
 
           // Fire off the request.
           // Note: I need to know whether the document has been permanently rejected or not,
but we currently have
@@ -1089,13 +1090,15 @@ public class HttpPoster
   */
   protected static class RepositoryDocumentStream extends ContentStreamBase
   {
-    protected InputStream is;
-    protected long length;
+    protected final InputStream is;
+    protected final long length;
+    protected final String contentType;
     
-    public RepositoryDocumentStream(InputStream is, long length)
+    public RepositoryDocumentStream(InputStream is, long length, String contentType)
     {
       this.is = is;
       this.length = length;
+      this.contentType = contentType;
     }
     
     @Override
@@ -1119,7 +1122,7 @@ public class HttpPoster
     @Override
     public String getContentType()
     {
-      return "application/octet-stream";
+      return contentType;
     }
 
   }

Modified: manifoldcf/branches/release-1.1-branch/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/WebcrawlerConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/release-1.1-branch/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/WebcrawlerConnector.java?rev=1434659&r1=1434658&r2=1434659&view=diff
==============================================================================
--- manifoldcf/branches/release-1.1-branch/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/WebcrawlerConnector.java
(original)
+++ manifoldcf/branches/release-1.1-branch/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/WebcrawlerConnector.java
Thu Jan 17 13:11:21 2013
@@ -1349,6 +1349,9 @@ public class WebcrawlerConnector extends
 
           RepositoryDocument rd = new RepositoryDocument();
 
+          // Set the content type
+          rd.setMimeType(cache.getContentType(documentIdentifier));
+          
           // Turn into acls and add into description
           String[] aclArray = new String[acls.size()];
           int j = 0;

Modified: manifoldcf/branches/release-1.1-branch/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/RepositoryDocument.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/release-1.1-branch/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/RepositoryDocument.java?rev=1434659&r1=1434658&r2=1434659&view=diff
==============================================================================
--- manifoldcf/branches/release-1.1-branch/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/RepositoryDocument.java
(original)
+++ manifoldcf/branches/release-1.1-branch/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/RepositoryDocument.java
Thu Jan 17 13:11:21 2013
@@ -45,6 +45,7 @@ public class RepositoryDocument
   protected Security shareSecurity = new Security();
   protected List<Security> directorySecurity = new ArrayList<Security>();
   protected String fileName = "docname";
+  protected String contentMimeType = "application/octet-stream";
   
   /** Constructor.
   */
@@ -52,6 +53,22 @@ public class RepositoryDocument
   {
   }
 
+  /** Set the document's mime type.
+  *@param mimeType is the mime type.
+  */
+  public void setMimeType(String mimeType)
+  {
+    contentMimeType = mimeType;
+  }
+  
+  /** Get the document's mime type.
+  *@return the mime type.
+  */
+  public String getMimeType()
+  {
+    return contentMimeType;
+  }
+  
   /** Set the document's "file" allow acls.
   *@param acl is the allowed "file" access control token list for the document.
   */



Mime
View raw message