You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@manifoldcf.apache.org by kw...@apache.org on 2014/07/17 07:56:54 UTC

svn commit: r1611254 - /manifoldcf/branches/CONNECTORS-998/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/FileConnector.java

Author: kwright
Date: Thu Jul 17 05:56:54 2014
New Revision: 1611254

URL: http://svn.apache.org/r1611254
Log:
Try to version directories, to reproduce the Derby bug

Modified:
    manifoldcf/branches/CONNECTORS-998/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/FileConnector.java

Modified: manifoldcf/branches/CONNECTORS-998/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/FileConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-998/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/FileConnector.java?rev=1611254&r1=1611253&r2=1611254&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-998/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/FileConnector.java (original)
+++ manifoldcf/branches/CONNECTORS-998/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/FileConnector.java Thu Jul 17 05:56:54 2014
@@ -223,11 +223,11 @@ public class FileConnector extends org.a
           // It's a directory.  The version ID would be the
           // last modified date, except that doesn't work on Windows
           // because modified dates are not transitive.
-          //long lastModified = file.lastModified();
-          //rval[i] = new Long(lastModified).toString();
+          long lastModified = file.lastModified();
+          rval[i] = new Long(lastModified).toString();
 
           // Signal that we don't have any versioning and that we should recheck always.
-          rval[i] = "";
+          //rval[i] = "";
         }
         else
         {
@@ -290,40 +290,42 @@ public class FileConnector extends org.a
       {
         if (file.isDirectory())
         {
-          // Chained connectors scan parent nodes always
-          // Queue up stuff for directory
-          long startTime = System.currentTimeMillis();
-          String errorCode = "OK";
-          String errorDesc = null;
-          String entityReference = documentIdentifier;
-          try
+          if (!scanOnly[i])
           {
+            activities.noDocument(documentIdentifier,version);
+            long startTime = System.currentTimeMillis();
+            String errorCode = "OK";
+            String errorDesc = null;
+            String entityReference = documentIdentifier;
             try
             {
-              File[] files = file.listFiles();
-              if (files != null)
+              try
               {
-                int j = 0;
-                while (j < files.length)
+                File[] files = file.listFiles();
+                if (files != null)
                 {
-                  File f = files[j++];
-                  String canonicalPath = f.getCanonicalPath();
-                  if (checkInclude(f,canonicalPath,spec))
-                    activities.addDocumentReference(canonicalPath,documentIdentifier,RELATIONSHIP_CHILD);
+                  int j = 0;
+                  while (j < files.length)
+                  {
+                    File f = files[j++];
+                    String canonicalPath = f.getCanonicalPath();
+                    if (checkInclude(f,canonicalPath,spec))
+                      activities.addDocumentReference(canonicalPath,documentIdentifier,RELATIONSHIP_CHILD);
+                  }
                 }
               }
+              catch (IOException e)
+              {
+                errorCode = "IO ERROR";
+                errorDesc = e.getMessage();
+                throw new ManifoldCFException("IO Error: "+e.getMessage(),e);
+              }
             }
-            catch (IOException e)
+            finally
             {
-              errorCode = "IO ERROR";
-              errorDesc = e.getMessage();
-              throw new ManifoldCFException("IO Error: "+e.getMessage(),e);
+              activities.recordActivity(new Long(startTime),ACTIVITY_READ,null,entityReference,errorCode,errorDesc,null);
             }
           }
-          finally
-          {
-            activities.recordActivity(new Long(startTime),ACTIVITY_READ,null,entityReference,errorCode,errorDesc,null);
-          }
         }
         else
         {