fix Sftp isDir bug

This commit is contained in:
Looly
2021-07-23 22:13:09 +08:00
parent 386d890390
commit a5894581ae
2 changed files with 6 additions and 0 deletions

View File

@@ -337,6 +337,11 @@ public class Sftp extends AbstractFtp {
try {
sftpATTRS = this.channel.stat(dir);
} catch (SftpException e) {
if(e.getMessage().contains("No such file")){
// 文件不存在直接返回false
// pr#378@Gitee
return false;
}
throw new FtpException(e);
}
return sftpATTRS.isDir();