Author: davsclaus
Date: Wed Jun 16 04:16:24 2010
New Revision: 955123
URL: http://svn.apache.org/viewvc?rev=955123&view=rev
Log:
CAMEL-2821: sftp fixed issue checking for file exists if directory did not
exist.
Modified:
camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java
Modified:
camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java
URL:
http://svn.apache.org/viewvc/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java?rev=955123&r1=955122&r2=955123&view=diff
==============================================================================
---
camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java
(original)
+++
camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java
Wed Jun 16 04:16:24 2010
@@ -470,6 +470,11 @@ public class SftpOperations implements R
}
return false;
} catch (SftpException e) {
+ // or an exception can be thrown with id 2 which means file does
not exists
+ if (ChannelSftp.SSH_FX_NO_SUCH_FILE == e.id) {
+ return false;
+ }
+ // otherwise its a more serious error so rethrow
throw new GenericFileOperationFailedException(e.getMessage(), e);
}
}