mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix Sftp isDir bug
This commit is contained in:
@@ -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();
|
||||
|
Reference in New Issue
Block a user