Author: davsclaus
Date: Tue Jan 13 07:55:53 2009
New Revision: 734164

URL: http://svn.apache.org/viewvc?rev=734164&view=rev
Log:
Fixed sftp consumer not being able to move files after processing, when trying 
to delete file before renaming to avoid name clash

Modified:
    
activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/strategy/RenameRemoteFileProcessStrategy.java

Modified: 
activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/strategy/RenameRemoteFileProcessStrategy.java
URL: 
http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/strategy/RenameRemoteFileProcessStrategy.java?rev=734164&r1=734163&r2=734164&view=diff
==============================================================================
--- 
activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/strategy/RenameRemoteFileProcessStrategy.java
 (original)
+++ 
activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/strategy/RenameRemoteFileProcessStrategy.java
 Tue Jan 13 07:55:53 2009
@@ -68,7 +68,13 @@
 
     private static RemoteFile renameFile(RemoteFileOperations operations, 
RemoteFile from, RemoteFile to) throws IOException {
         // deleting any existing files before renaming
-        boolean deleted = operations.deleteFile(to.getAbsolutelFileName());
+        boolean deleted = false;
+        try {
+            deleted = operations.deleteFile(to.getAbsolutelFileName());
+        } catch (RemoteFileOperationFailedException e) {
+            // ignore the file does not exists
+        }
+
         if (!deleted) {
             // if we could not delete any existing file then maybe the folder 
is missing
             // build folder if needed


Reply via email to