fix the fix for #90 - need to statExistence of targetCwd not cwd

This commit is contained in:
Shikhar Bhushan
2013-09-07 11:39:28 -04:00
parent 78e5a2e30e
commit 5159a799df

View File

@@ -41,8 +41,8 @@ public class StatefulSFTPClient
public synchronized void cd(String dirname)
throws IOException {
final String targetCwd = cwdify(dirname);
if (statExistence(cwd) == null) {
throw new SFTPException(cwd + ": does not exist");
if (statExistence(targetCwd) == null) {
throw new SFTPException(targetCwd + ": does not exist");
}
cwd = targetCwd;
log.debug("CWD = {}", cwd);