Handle case where File looks like Attachment

A Document Library can contain a Folder called Attachments, and a File
could be named in the 10_.000 style of an Attachment. So if the parent
LI doesn't have any attachments (as is the case for Folders in Document
Libraries), return that the DocId isn't an attachment.
diff --git a/src/com/google/enterprise/adaptor/sharepoint/SharePointAdaptor.java b/src/com/google/enterprise/adaptor/sharepoint/SharePointAdaptor.java
index 3cdcda5..7f9955e 100644
--- a/src/com/google/enterprise/adaptor/sharepoint/SharePointAdaptor.java
+++ b/src/com/google/enterprise/adaptor/sharepoint/SharePointAdaptor.java
@@ -2182,6 +2182,18 @@
           = row.getAttribute(OWS_SCOPEID_ATTRIBUTE).split(";#", 2)[1];
       scopeId = scopeId.toLowerCase(Locale.ENGLISH);
 
+      String strAttachments = row.getAttribute(OWS_ATTACHMENTS_ATTRIBUTE);
+      int attachments = (strAttachments == null || "".equals(strAttachments))
+          ? 0 : Integer.parseInt(strAttachments);
+      if (attachments <= 0) {
+        // Either the attachment has been removed or there was a really odd
+        // collection of documents in a Document Library. Therefore, we let the
+        // code continue to try to determine if this is a File.
+        log.fine("Parent list item has no child attachments");
+        log.exiting("SiteAdaptor", "getAttachmentDocContent", false);
+        return false;
+      }
+
       boolean allowAnonymousAccess = isAllowAnonymousReadForList(l)
           && scopeId.equals(l.scopeId.toLowerCase(Locale.ENGLISH))
           && isAllowAnonymousPeekForWeb(w)