You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by dk...@apache.org on 2011/10/03 20:26:03 UTC

svn commit: r1178495 - in /camel/branches/camel-2.8.x: ./ components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpOperations.java components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java

Author: dkulp
Date: Mon Oct  3 18:26:03 2011
New Revision: 1178495

URL: http://svn.apache.org/viewvc?rev=1178495&view=rev
Log:
Merged revisions 1178132 via svnmerge from 
https://svn.apache.org/repos/asf/camel/trunk

........
  r1178132 | davsclaus | 2011-10-02 02:58:19 -0400 (Sun, 02 Oct 2011) | 1 line
  
  CAMEL-4505: Added option copyAndDeleteOnRenameFail to file component.
........

Modified:
    camel/branches/camel-2.8.x/   (props changed)
    camel/branches/camel-2.8.x/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpOperations.java
    camel/branches/camel-2.8.x/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java

Propchange: camel/branches/camel-2.8.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-2.8.x/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpOperations.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpOperations.java?rev=1178495&r1=1178494&r2=1178495&view=diff
==============================================================================
--- camel/branches/camel-2.8.x/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpOperations.java (original)
+++ camel/branches/camel-2.8.x/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpOperations.java Mon Oct  3 18:26:03 2011
@@ -430,8 +430,12 @@ public class FtpOperations implements Re
         if (result) {
             log.trace("Renaming local in progress file from: {} to: {}", temp, local);
             // operation went okay so rename temp to local after we have retrieved the data
-            if (!FileUtil.renameFile(temp, local)) {
-                throw new GenericFileOperationFailedException("Cannot rename local work file from: " + temp + " to: " + local);
+            try {
+                if (!FileUtil.renameFile(temp, local, false)) {
+                    throw new GenericFileOperationFailedException("Cannot rename local work file from: " + temp + " to: " + local);
+                }
+            } catch (IOException e) {
+                throw new GenericFileOperationFailedException("Cannot rename local work file from: " + temp + " to: " + local, e);
             }
         }
 

Modified: camel/branches/camel-2.8.x/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java?rev=1178495&r1=1178494&r2=1178495&view=diff
==============================================================================
--- camel/branches/camel-2.8.x/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java (original)
+++ camel/branches/camel-2.8.x/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java Mon Oct  3 18:26:03 2011
@@ -589,8 +589,12 @@ public class SftpOperations implements R
 
         // operation went okay so rename temp to local after we have retrieved the data
         LOG.trace("Renaming local in progress file from: {} to: {}", temp, local);
-        if (!FileUtil.renameFile(temp, local)) {
-            throw new GenericFileOperationFailedException("Cannot rename local work file from: " + temp + " to: " + local);
+        try {
+            if (!FileUtil.renameFile(temp, local, false)) {
+                throw new GenericFileOperationFailedException("Cannot rename local work file from: " + temp + " to: " + local);
+            }
+        } catch (IOException e) {
+            throw new GenericFileOperationFailedException("Cannot rename local work file from: " + temp + " to: " + local, e);
         }
 
         return true;