mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
fix Sftp isDir bug
This commit is contained in:
parent
386d890390
commit
a5894581ae
@ -16,6 +16,7 @@
|
||||
### 🐞Bug修复
|
||||
* 【core 】 修复RobotUtil双击右键问题(pr#1721@Github)
|
||||
* 【core 】 修复FileTypeUtil判断wps修改过的xlsx误判为jar的问题(pr#380@Gitee)
|
||||
* 【core 】 修复Sftp.isDir异常bug(pr#378@Gitee)
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user