Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
Nightly Builds
-
None
Description
SftpFileObject.doListChildrenResolved() changes the working dir before doing ChannelSftp.ls() call. If ls() throws an exception (in my case it's SftpException "No such file" when trying to list the contents of "/dev/cdrom"), the execution is blown out the method and channel.cd(workingDirectory) is not performed. All the subsequent operations that rely on the current dir will fail trying to cd() into unexisting directory.
The fix will be to move the channel.cd(workingDirectory); part into the finally {} block below