修复isDir判断改变pwd的问题

This commit is contained in:
yebukong
2022-08-31 12:54:35 +08:00
parent b1642d4625
commit 4852d67bed
2 changed files with 16 additions and 1 deletions

View File

@@ -73,7 +73,12 @@ public abstract class AbstractFtp implements Closeable {
* @since 5.7.5
*/
public boolean isDir(String dir) {
return cd(dir);
final String workDir = pwd();
try {
return cd(dir);
} finally {
cd(workDir);
}
}
/**