camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r734164 - /activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/strategy/RenameRemoteFileProcessStrategy.java
Date Tue, 13 Jan 2009 15:56:06 GMT
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



Mime
View raw message