manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1632588 - in /manifoldcf/branches/dev_1x: ./ connectors/tika/connector/src/main/java/org/apache/manifoldcf/agents/transformation/tika/TikaExtractor.java
Date Fri, 17 Oct 2014 14:39:36 GMT
Author: kwright
Date: Fri Oct 17 14:39:35 2014
New Revision: 1632588

URL: http://svn.apache.org/r1632588
Log:
Pull up tika change for CONNECTORS-1077 from trunk.

Modified:
    manifoldcf/branches/dev_1x/   (props changed)
    manifoldcf/branches/dev_1x/connectors/tika/connector/src/main/java/org/apache/manifoldcf/agents/transformation/tika/TikaExtractor.java

Propchange: manifoldcf/branches/dev_1x/
------------------------------------------------------------------------------
  Merged /manifoldcf/trunk:r1632562

Modified: manifoldcf/branches/dev_1x/connectors/tika/connector/src/main/java/org/apache/manifoldcf/agents/transformation/tika/TikaExtractor.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/connectors/tika/connector/src/main/java/org/apache/manifoldcf/agents/transformation/tika/TikaExtractor.java?rev=1632588&r1=1632587&r2=1632588&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/connectors/tika/connector/src/main/java/org/apache/manifoldcf/agents/transformation/tika/TikaExtractor.java
(original)
+++ manifoldcf/branches/dev_1x/connectors/tika/connector/src/main/java/org/apache/manifoldcf/agents/transformation/tika/TikaExtractor.java
Fri Oct 17 14:39:35 2014
@@ -157,6 +157,8 @@ public class TikaExtractor extends org.a
     if (!activities.checkMimeTypeIndexable("text/plain;charset=utf-8"))
     {
       activities.noDocument();
+      activities.recordActivity(null, ACTIVITY_EXTRACT, null, documentURI,
+        "MIMETYPEREJECTION", "Downstream pipeline rejected mime type 'text/plain;charset=utf-8'");
       return DOCUMENTSTATUS_REJECTED;
     }
 
@@ -263,6 +265,16 @@ public class TikaExtractor extends org.a
           os.close();
           length = new Long(ds.getBinaryLength());
         }
+        
+        // Check to be sure downstream pipeline will accept document of specified length
+        if (!activities.checkLengthIndexable(ds.getBinaryLength()))
+        {
+          activities.noDocument();
+          resultCode = "LENGTHREJECTION";
+          description = "Downstream pipeline rejected document with length "+ds.getBinaryLength();
+          return DOCUMENTSTATUS_REJECTED;
+        }
+
       }
       finally
       {
@@ -271,13 +283,6 @@ public class TikaExtractor extends org.a
           resultCode, description);
       }
       
-      // Check to be sure downstream pipeline will accept document of specified length
-      if (!activities.checkLengthIndexable(ds.getBinaryLength()))
-      {
-        activities.noDocument();
-        return DOCUMENTSTATUS_REJECTED;
-      }
-        
       // Parsing complete!
       // Create a copy of Repository Document
       RepositoryDocument docCopy = document.duplicate();



Mime
View raw message