Sidebar

How do I specify a relative path for FTP?

0 votes
2.3K views
asked May 22, 2020 by lewis-s-9714 (1,020 points)
We just updated to version 4.0.47.12663 and We're getting a warning when we use a path like "/Entry/Prelim/Out" for an SFTP that we're using an absolute path and in future versions we will need to use a relative path. I'm a little confused about the terminology here, as I thought absolute path would be something like sftp://www.place.com:11/Entry/Prelim/Out" but perhaps it's something to do with the starting point of the login? If that is the case, it appears to be we start in "Entry/Prelim" but if that's the case, why is "Out" for a path keep giving errors?

The issue isn't that we can't find the files... the system is finding them fine with either method, but we're getting errors in the status queue saying "org.apache.camel.component.file.GenericFileOperationFailedException: Cannot change directory to: /
    at org.apache.camel.component.file.remote.SftpOperations.doChangeDirectory(SftpOperations.java:556)" if we use "/Entry/Prelim/Out", and if we use "Out" for the path we get the same error, only saying: Cannot change directory to: Out.

How do we specify the correct relative path? Should we be ignoring this error if the file is still coming through fine?

1 Answer

0 votes
It depends on how the FTP was setup, but in your example you could try Entry/Prelim/Out. All paths are relative to the specified entry point defined for the specific FTP user (often a home directory).  You will need to have permissions to be able to read each directory in your path and to write/modify/delete from the Out folder in this case.  That way we can archive from a source node, or write in the folder if it is a destination node.
answered May 22, 2020 by gary-t-8719 (15,130 points)
commented May 22, 2020 by lewis-s-9714 (1,020 points)
It still finds the file and processes it, but I still see the error too, this time it includes "Cannot change directory to: ..
    at org.apache.camel.component.file.remote.SftpOperations.doChangeDirectory(SftpOperations.java:556)"
commented May 22, 2020 by lewis-s-9714 (1,020 points)
I think I get it. I needed to check "Disconnect after use" because it's remembering what path it was on from before. In my case I also needed to use "Traverse directories".
...