manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1360683 - /manifoldcf/branches/CONNECTORS-470/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SPSProxyHelper.java
Date Thu, 12 Jul 2012 13:52:30 GMT
Author: kwright
Date: Thu Jul 12 13:52:30 2012
New Revision: 1360683

URL: http://svn.apache.org/viewvc?rev=1360683&view=rev
Log:
Strip off all metadata prefixes matching ####;#

Modified:
    manifoldcf/branches/CONNECTORS-470/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SPSProxyHelper.java

Modified: manifoldcf/branches/CONNECTORS-470/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SPSProxyHelper.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-470/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SPSProxyHelper.java?rev=1360683&r1=1360682&r2=1360683&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-470/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SPSProxyHelper.java
(original)
+++ manifoldcf/branches/CONNECTORS-470/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SPSProxyHelper.java
Thu Jul 12 13:52:30 2012
@@ -23,6 +23,7 @@ import java.util.Map;
 import java.util.Hashtable;
 import java.util.Iterator;
 import java.util.List;
+import java.util.regex.*;
 
 import java.io.InputStream;
 
@@ -2060,11 +2061,27 @@ public class SPSProxyHelper {
     }
   }
 
+  // Regexp pattern to match 12345;#
+  protected static Pattern subsPattern;
+  static
+  {
+    try
+    {
+      subsPattern = Pattern.compile("[0-9]*;#.*");
+    }
+    catch (Exception e)
+    {
+      e.printStackTrace();
+      System.exit(-100);
+    }
+  }
+  
   /** Substitute progid where found */
   protected static String progIDSubstitute(String progID, String value)
   {
-    if (value.startsWith(progID))
-      return value.substring(progID.length());
+    Matcher matcher = subsPattern.matcher(value);
+    if (matcher.matches())
+      return value.substring(value.indexOf("#") + 1);
     return value;
   }
   



Mime
View raw message