camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject git commit: CAMEL-6335 Sftp cannot change to parent directory in a stepwise fashion
Date Fri, 19 Jul 2013 08:00:56 GMT
Updated Branches:
  refs/heads/master 6c3eaab22 -> a9ec7554d


CAMEL-6335 Sftp cannot change to parent directory in a stepwise fashion


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/a9ec7554
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/a9ec7554
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/a9ec7554

Branch: refs/heads/master
Commit: a9ec7554ddcdbd651b9c24e4e1ffebf6a33bbb8b
Parents: 6c3eaab
Author: Akitoshi Yoshida <ay@apache.org>
Authored: Fri Jul 19 10:00:09 2013 +0200
Committer: Akitoshi Yoshida <ay@apache.org>
Committed: Fri Jul 19 10:00:09 2013 +0200

----------------------------------------------------------------------
 .../org/apache/camel/component/file/remote/SftpOperations.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/a9ec7554/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java
----------------------------------------------------------------------
diff --git a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java
b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java
index 85a7d9e..9b1ecac 100644
--- a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java
+++ b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java
@@ -494,8 +494,8 @@ public class SftpOperations implements RemoteFileOperations<ChannelSftp.LsEntry>
             return;
         }
         if (getCurrentDirectory().startsWith(path)) {
-            // use relative path
-            String p = getCurrentDirectory().substring(path.length());
+            // extract the path segment relative to the target path and make sure it keeps
the preceding '/' for the regex op
+            String p = getCurrentDirectory().substring(path.length() - (path.endsWith("/")
?  1 : 0));
             if (p.length() == 0) {
                 return;
             }


Mime
View raw message