You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@manifoldcf.apache.org by mo...@apache.org on 2014/10/18 23:52:49 UTC

svn commit: r1632847 - /manifoldcf/trunk/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/agents/output/filesystem/FileOutputConnector.java

Author: molgun
Date: Sat Oct 18 21:52:49 2014
New Revision: 1632847

URL: http://svn.apache.org/r1632847
Log:
Oops I commited wrong local branch

Modified:
    manifoldcf/trunk/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/agents/output/filesystem/FileOutputConnector.java

Modified: manifoldcf/trunk/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/agents/output/filesystem/FileOutputConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/agents/output/filesystem/FileOutputConnector.java?rev=1632847&r1=1632846&r2=1632847&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/agents/output/filesystem/FileOutputConnector.java (original)
+++ manifoldcf/trunk/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/agents/output/filesystem/FileOutputConnector.java Sat Oct 18 21:52:49 2014
@@ -292,16 +292,20 @@ public class FileOutputConnector extends
         }
       }
     } catch (URISyntaxException e) {
-      handleURISyntaxException(e,activities);
+      activities.recordActivity(null,INGEST_ACTIVITY,new Long(document.getBinaryLength()), documentURI,activities.EXCEPTION,"Rejected due to URISyntaxException");
+      handleURISyntaxException(e);
       return DOCUMENTSTATUS_REJECTED;
     } catch (FileNotFoundException e) {
-      handleFileNotFoundException(e,activities);
+      activities.recordActivity(null,INGEST_ACTIVITY,new Long(document.getBinaryLength()), documentURI,activities.EXCEPTION,"Rejected due to FileNotFoundException");
+      handleFileNotFoundException(e);
       return DOCUMENTSTATUS_REJECTED;
     } catch (SecurityException e) {
-      handleSecurityException(e,activities);
+      activities.recordActivity(null,INGEST_ACTIVITY,new Long(document.getBinaryLength()), documentURI,activities.EXCEPTION,"Rejected due to SecurityException");
+      handleSecurityException(e);
       return DOCUMENTSTATUS_REJECTED;
     } catch (IOException e) {
-      handleIOException(e,activities);
+      activities.recordActivity(null,INGEST_ACTIVITY,new Long(document.getBinaryLength()), documentURI ,activities.EXCEPTION,"Rejected due to IOException.");
+      handleIOException(e);
       return DOCUMENTSTATUS_REJECTED;
     }
 
@@ -315,26 +319,26 @@ public class FileOutputConnector extends
     throw new ManifoldCFException(e.getMessage(),e);
   }
 
-  protected static void handleURISyntaxException(URISyntaxException e, IOutputHistoryActivity activities)
+  protected static void handleURISyntaxException(URISyntaxException e)
     throws ManifoldCFException, ServiceInterruption {
     Logging.agents.error("FileSystem: URISyntaxException: "+e.getMessage(),e);
     throw new ManifoldCFException(e.getMessage(),e);
   }
 
-  protected static void handleSecurityException(SecurityException e, IOutputHistoryActivity activities)
+  protected static void handleSecurityException(SecurityException e)
     throws ManifoldCFException, ServiceInterruption {
     Logging.agents.error("FileSystem: SecurityException: "+e.getMessage(),e);
     throw new ManifoldCFException(e.getMessage(),e);
   }
 
-  protected static void handleFileNotFoundException(FileNotFoundException e, IOutputHistoryActivity activities)
+  protected static void handleFileNotFoundException(FileNotFoundException e)
     throws ManifoldCFException, ServiceInterruption {
     Logging.agents.error("FileSystem: Path is illegal: "+e.getMessage(),e);
     throw new ManifoldCFException(e.getMessage(),e);
   }
 
   /** Handle IOException */
-  protected static void handleIOException(IOException e, IOutputHistoryActivity activities)
+  protected static void handleIOException(IOException e)
     throws ManifoldCFException, ServiceInterruption
   {
     if (!(e instanceof java.net.SocketTimeoutException) && (e instanceof InterruptedIOException)) {
@@ -435,13 +439,17 @@ public class FileOutputConnector extends
       // Just close it, to make a zero-length grave marker.
       output.close();
     } catch (URISyntaxException e) {
-      handleURISyntaxException(e,activities);
+      activities.recordActivity(null,REMOVE_ACTIVITY,null, documentURI,activities.EXCEPTION,"Rejected due to URISyntaxException");
+      handleURISyntaxException(e);
     } catch (FileNotFoundException e) {
-      handleFileNotFoundException(e,activities);
+      activities.recordActivity(null,REMOVE_ACTIVITY,null, documentURI,activities.EXCEPTION,"Rejected due to FileNotFoundException");
+      handleFileNotFoundException(e);
     } catch (SecurityException e) {
-      handleSecurityException(e,activities);
+      activities.recordActivity(null,REMOVE_ACTIVITY,null, documentURI,activities.EXCEPTION,"Rejected due to SecurityException");
+      handleSecurityException(e);
     } catch (IOException e) {
-      handleIOException(e,activities);
+      activities.recordActivity(null,INGEST_ACTIVITY,null, documentURI ,activities.EXCEPTION,"Rejected due to IOException.");
+      handleIOException(e);
     }
 
     activities.recordActivity(null, REMOVE_ACTIVITY, null, documentURI, "OK", null);