Updated Branches: refs/heads/camel-2.10.x e9f2a1f86 -> a9db81ce1
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/a9db81ce Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/a9db81ce Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/a9db81ce Branch: refs/heads/camel-2.10.x Commit: a9db81ce190ef292880ff329b60addde9f666abd Parents: e9f2a1f 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:13:55 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/a9db81ce/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 61cf8dd..dd4934c 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 @@ -420,8 +420,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; }