This commit is contained in:
looly 2022-01-04 17:36:07 +08:00
parent a3b9b0ac6b
commit c28a202c14
2 changed files with 4 additions and 1 deletions

View File

@ -11,6 +11,7 @@
* 【core 】 CharSequenceUtil.replace方法支持增补字符pr#2041@Github * 【core 】 CharSequenceUtil.replace方法支持增补字符pr#2041@Github
* 【extra 】 增加SshjSftppr#493@Gitee * 【extra 】 增加SshjSftppr#493@Gitee
* 【core 】 增加CheckedUtilpr#491@Gitee * 【core 】 增加CheckedUtilpr#491@Gitee
* 【extra 】 增加Sftp.isDir中的抛异常判断条件issues#I4P9ED@Gitee
### 🐞Bug修复 ### 🐞Bug修复
* 【http 】 HttpUtil重定向次数失效问题issue#I4O28Q@Gitee * 【http 】 HttpUtil重定向次数失效问题issue#I4O28Q@Gitee

View File

@ -338,7 +338,9 @@ public class Sftp extends AbstractFtp {
try { try {
sftpATTRS = this.channel.stat(dir); sftpATTRS = this.channel.stat(dir);
} catch (SftpException e) { } catch (SftpException e) {
if (e.getMessage().contains("No such file")) { final String msg = e.getMessage();
// issue#I4P9ED@Gitee
if (msg.contains("No such file") || msg.contains("does not exist")) {
// 文件不存在直接返回false // 文件不存在直接返回false
// pr#378@Gitee // pr#378@Gitee
return false; return false;