Author: kwright
Date: Wed Jul 17 11:02:25 2013
New Revision: 1504073

URL: http://svn.apache.org/r1504073
Log:
Harden connector against failures in the MCPermission.asmx plugin.  Part of 
CONNECTORS-754.

Modified:
    
manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SharePointRepository.java

Modified: 
manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SharePointRepository.java
URL: 
http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SharePointRepository.java?rev=1504073&r1=1504072&r2=1504073&view=diff
==============================================================================
--- 
manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SharePointRepository.java
 (original)
+++ 
manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SharePointRepository.java
 Wed Jul 17 11:02:25 2013
@@ -1887,9 +1887,16 @@ public class SharePointRepository extend
       {
         // Since the processing for a file needs to know the library path, we 
need a way to signal the cutoff between library and folder levels.
         // The way I've chosen to do this is to use a double slash at that 
point, as a separator.
-        String modifiedPath = relPath.substring(0,foldersFilePathIndex) + "/" 
+ relPath.substring(foldersFilePathIndex);
+        if (relPath.length() >= foldersFilePathIndex)
+        {
+          String modifiedPath = relPath.substring(0,foldersFilePathIndex) + 
"/" + relPath.substring(foldersFilePathIndex);
 
-        activities.addDocumentReference( modifiedPath );
+          activities.addDocumentReference( modifiedPath );
+        }
+        else
+        {
+          Logging.connectors.warn("Sharepoint: Unexpected relPath structure; 
path is '"+relPath+"', but expected <list/library> length of 
"+foldersFilePathIndex);
+        }
       }
     }
   }


Reply via email to