manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1789511 - /manifoldcf/trunk/connectors/email/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/email/EmailConnector.java
Date Thu, 30 Mar 2017 12:25:34 GMT
Author: kwright
Date: Thu Mar 30 12:25:33 2017
New Revision: 1789511

URL: http://svn.apache.org/viewvc?rev=1789511&view=rev
Log:
Strip anything after the semicolon off of the mime type for MS Exchange

Modified:
    manifoldcf/trunk/connectors/email/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/email/EmailConnector.java

Modified: manifoldcf/trunk/connectors/email/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/email/EmailConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/email/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/email/EmailConnector.java?rev=1789511&r1=1789510&r2=1789511&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/email/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/email/EmailConnector.java
(original)
+++ manifoldcf/trunk/connectors/email/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/email/EmailConnector.java
Thu Mar 30 12:25:33 2017
@@ -803,10 +803,12 @@ public class EmailConnector extends org.
                 
               final String origMimeType = part.getContentType();
               final String mimeType;
-              if (origMimeType == null || origMimeType.indexOf("\n") == -1) {
+              //MSExchange puts crap after the mime type so it has to be munged.
+              // Example: "application/msword; name=SampleDOCFile_100kb.doc"
+              if (origMimeType == null || origMimeType.indexOf(";") == -1) {
                 mimeType = origMimeType;
               } else {
-                mimeType = origMimeType.substring(0, origMimeType.indexOf("\n")).trim();
+                mimeType = origMimeType.substring(0, origMimeType.indexOf(";"));
               }
               if (!activities.checkMimeTypeIndexable(mimeType)) {
                 errorCode = activities.EXCLUDED_MIMETYPE;



Mime
View raw message