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/10/10 02:07:20 UTC
svn commit: r1630621 -
/manifoldcf/branches/CONNECTORS-1068/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/FileConnector.java
Author: kwright
Date: Fri Oct 10 00:07:19 2014
New Revision: 1630621
URL: http://svn.apache.org/r1630621
Log:
Add additional activity logging
Modified:
manifoldcf/branches/CONNECTORS-1068/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/FileConnector.java
Modified: manifoldcf/branches/CONNECTORS-1068/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/FileConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1068/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/FileConnector.java?rev=1630621&r1=1630620&r2=1630621&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1068/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/FileConnector.java (original)
+++ manifoldcf/branches/CONNECTORS-1068/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/FileConnector.java Fri Oct 10 00:07:19 2014
@@ -298,31 +298,23 @@ public class FileConnector extends org.a
String versionString;
String convertPath;
long fileLength = file.length();
- if (activities.checkLengthIndexable(fileLength))
- {
- // Get the file's modified date.
- long lastModified = file.lastModified();
+ // Get the file's modified date.
+ long lastModified = file.lastModified();
- // Check if the path is to be converted. We record that info in the version string so that we'll reindex documents whose
- // URI's change.
- convertPath = findConvertPath(spec, file);
- StringBuilder sb = new StringBuilder();
- if (convertPath != null)
- {
- // Record the path.
- sb.append("+");
- pack(sb,convertPath,'+');
- }
- else
- sb.append("-");
- sb.append(new Long(lastModified).toString()).append(":").append(new Long(fileLength).toString());
- versionString = sb.toString();
- }
- else
+ // Check if the path is to be converted. We record that info in the version string so that we'll reindex documents whose
+ // URI's change.
+ convertPath = findConvertPath(spec, file);
+ StringBuilder sb = new StringBuilder();
+ if (convertPath != null)
{
- activities.deleteDocument(documentIdentifier);
- continue;
+ // Record the path.
+ sb.append("+");
+ pack(sb,convertPath,'+');
}
+ else
+ sb.append("-");
+ sb.append(new Long(lastModified).toString()).append(":").append(new Long(fileLength).toString());
+ versionString = sb.toString();
if (activities.checkDocumentNeedsReindexing(documentIdentifier,versionString))
{
@@ -345,6 +337,7 @@ public class FileConnector extends org.a
{
Logging.connectors.debug("Skipping file '"+documentIdentifier+"' because length was excluded by output connector.");
activities.noDocument(documentIdentifier,versionString);
+ activities.recordActivity(null,ACTIVITY_READ,null,documentIdentifier,"FILETOOLONG","Document rejected because of length",null);
continue;
}
@@ -352,6 +345,7 @@ public class FileConnector extends org.a
{
Logging.connectors.debug("Skipping file '"+documentIdentifier+"' because URL was excluded by output connector.");
activities.noDocument(documentIdentifier,versionString);
+ activities.recordActivity(null,ACTIVITY_READ,null,documentIdentifier,"URLREJECTED","Document rejected because of URL",null);
continue;
}
@@ -359,6 +353,7 @@ public class FileConnector extends org.a
{
Logging.connectors.debug("Skipping file '"+documentIdentifier+"' because date ("+modifiedDate+") was excluded by output connector.");
activities.noDocument(documentIdentifier,versionString);
+ activities.recordActivity(null,ACTIVITY_READ,null,documentIdentifier,"DATEREJECTED","Document rejected because of date",null);
continue;
}
@@ -366,6 +361,7 @@ public class FileConnector extends org.a
{
Logging.connectors.debug("Skipping file '"+documentIdentifier+"' because mime type ('"+mimeType+"') was excluded by output connector.");
activities.noDocument(documentIdentifier,versionString);
+ activities.recordActivity(null,ACTIVITY_READ,null,documentIdentifier,"MIMETYPEREJECTED","Document rejected because of mime type",null);
continue;
}