You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2010/06/16 06:47:57 UTC

svn commit: r955126 - /camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java

Author: davsclaus
Date: Wed Jun 16 04:47:57 2010
New Revision: 955126

URL: http://svn.apache.org/viewvc?rev=955126&view=rev
Log:
CAMEL-2817: check for boolean false returned when retriving files, so we can react and indicate a failure.

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java?rev=955126&r1=955125&r2=955126&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java Wed Jun 16 04:47:57 2010
@@ -251,7 +251,14 @@ public abstract class GenericFileConsume
                 log.trace("Retrieving file: " + name + " from: " + endpoint);
             }
 
-            operations.retrieveFile(name, exchange);
+            // retrieve the file and check it was a success
+            boolean retrieved = operations.retrieveFile(name, exchange);
+            if (!retrieved) {
+                // throw exception to handle the problem with retrieving the file
+                // then if the method return false or throws an exception is handled the same in here
+                // as in both cases an exception is being thrown
+                throw new GenericFileOperationFailedException("Cannot retrieve file: " + file + " from: " + endpoint);
+            }
 
             if (log.isTraceEnabled()) {
                 log.trace("Retrieved file: " + name + " from: " + endpoint);