Updated Branches: refs/heads/camel-2.11.x fdfd3d86e -> a2676b741
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/a2676b74 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/a2676b74 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/a2676b74 Branch: refs/heads/camel-2.11.x Commit: a2676b74136dd20f11cc19bdeeb0194cec883e40 Parents: fdfd3d8 Author: Akitoshi Yoshida <a...@apache.org> Authored: Fri Jul 19 10:00:09 2013 +0200 Committer: Akitoshi Yoshida <a...@apache.org> Committed: Fri Jul 19 10:08:11 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/a2676b74/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 d0ef269..c3e2b6d 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 @@ -473,8 +473,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; }