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

@ -16,6 +16,7 @@
### 🐞Bug修复
* 【core 】 修复RobotUtil双击右键问题pr#1721@Github
* 【core 】 修复FileTypeUtil判断wps修改过的xlsx误判为jar的问题pr#380@Gitee
* 【core 】 修复Sftp.isDir异常bugpr#378@Gitee
-------------------------------------------------------------------------------------------------------------

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();