This is an automated email from the ASF dual-hosted git repository. onders pushed a commit to branch camel-2.x in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-2.x by this push: new 3d92c7d CAMEL-13017 - handle root path on windows 3d92c7d is described below commit 3d92c7d1e6ef305b062dd556402ec25a45c5fdc9 Author: onders <ond...@apache.org> AuthorDate: Thu Dec 20 01:15:39 2018 +0300 CAMEL-13017 - handle root path on windows --- .../apache/camel/component/file/remote/SftpOperations.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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 834595a..ecdc583 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 @@ -618,12 +618,17 @@ public class SftpOperations implements RemoteFileOperations<SftpRemoteFile> { // that if (FileUtil.hasLeadingSeparator(path)) { // change to root path - if (!FileUtil.isWindows()) { + if (!path.matches("^[a-zA-Z]:(//|\\\\).*$")) { doChangeDirectory(path.substring(0, 1)); path = path.substring(1); } else { - doChangeDirectory(path.substring(0, 4)); - path = path.substring(4); + if(path.matches("^[a-zA-Z]:(//).*$")) { + doChangeDirectory(path.substring(0, 3)); + path = path.substring(3); + } else if(path.matches("^[a-zA-Z]:(\\\\).*$")) { + doChangeDirectory(path.substring(0, 4)); + path = path.substring(4); + } } }