You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "Goyal, Arpit" <ar...@sap.com> on 2016/12/22 09:11:44 UTC
Support SFTP Absolute Path for directory
Hi All,
Camel doesn't support absolute path based on the documentation - Where directoryname represents the underlying directory. The directory name is a relative path. Absolute paths are not supported.
Due to which when we send /Home/Inbound/Data.csv as part of the URL, the actual value reaching to JSCH for writing becomes /Home/Inbound/Home/Inbound/Data.csv & we get exception - No Such File.
JSCH version 0.1.50 & Apache Camel 1.16.3 version
--------------------------------------------------------------
1. com.jcraft.jsch.ChannelSftp.put(InputStream, String, SftpProgressMonitor, int) --> gets second parameter as Home/Inbound
2. com.jcraft.jsch.ChannelSftp.remoteAbsolutePath(String)
a. Tries to get Cwd
b. Tries to get Home, which comes back as /Home/Inbound
3. Path becomes /Home/Inbound/Home/Inbound
Writing for file fails as the folder doesn't exists.
Question 1: Anyone has any resolution how to resolve this. Camel always strip all '/' before sending it to JSCH to support only relative path.
Question 2: Also, Can we configure something on Sftp server that 'getHome' method returns '/' rather /Home/Inbound?
Regards,
Arpit.
RE: Support SFTP Absolute Path for directory
Posted by "Goyal, Arpit" <ar...@sap.com>.
Found two of the issues raised earlier, but still it didn't explain the much about what is the security issue and what problem people faced.
https://issues.apache.org/jira/browse/CAMEL-8828
https://issues.apache.org/jira/browse/CAMEL-8844
If anyone has, do share the problem faced. As we never did with native sftp implementation.
Regards,
Arpit.
-----Original Message-----
From: Goyal, Arpit [mailto:arpit.goyal@sap.com]
Sent: Thursday, December 22, 2016 1:12 AM
To: users@camel.apache.org
Subject: Support SFTP Absolute Path for directory
Hi All,
Camel doesn't support absolute path based on the documentation - Where directoryname represents the underlying directory. The directory name is a relative path. Absolute paths are not supported.
Due to which when we send /Home/Inbound/Data.csv as part of the URL, the actual value reaching to JSCH for writing becomes /Home/Inbound/Home/Inbound/Data.csv & we get exception - No Such File.
JSCH version 0.1.50 & Apache Camel 1.16.3 version
--------------------------------------------------------------
1. com.jcraft.jsch.ChannelSftp.put(InputStream, String, SftpProgressMonitor, int) --> gets second parameter as Home/Inbound
2. com.jcraft.jsch.ChannelSftp.remoteAbsolutePath(String)
a. Tries to get Cwd
b. Tries to get Home, which comes back as /Home/Inbound
3. Path becomes /Home/Inbound/Home/Inbound
Writing for file fails as the folder doesn't exists.
Question 1: Anyone has any resolution how to resolve this. Camel always strip all '/' before sending it to JSCH to support only relative path.
Question 2: Also, Can we configure something on Sftp server that 'getHome' method returns '/' rather /Home/Inbound?
Regards,
Arpit.