Bad FTPFile paths in getDirectoryListing(String)
Brought to you by:
arnold_mad,
kurt_tas
When calling getDirectoryListing(aDirectory), where <i>aDirectory</i> is a subdirectory of the working directory, the FTPFile's full paths are wrong. They all point to the working directory instead of the expected directory although the name list is the one of <i>aDirectory</i>.
In getDirectoryListing(String) source code, getWorkingDirectory() is always used to provide the path. I modified both getDirectoryListing() methods to get the execution and the full paths of the returned FTPFile list correct in both cases. You can find my code attached.
Thanks in advance for taking in into account.
Correction proposition
Hello, I noticed the same behavior, but your code still produces wrong paths.
Example:
Work directory: /a/b/
call getDirectoryListing(path), path = a/b/c
-> produces a path like /a/b//a/b/c
Workaround from the original code is to change directory first, and then to call getDirectoryListing() with no arguments.
A fix could be easy to do, maybe I will have a closer look into it later.
could you provide a proper patch please ?