mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
修复Sftp中exists方法父目录不存在时报错
This commit is contained in:
parent
04e41a6098
commit
3cd8a0182f
@ -136,6 +136,10 @@ public abstract class AbstractFtp implements Closeable {
|
|||||||
|
|
||||||
// 文件验证
|
// 文件验证
|
||||||
final String dir = StrUtil.defaultIfEmpty(StrUtil.removeSuffix(path, fileName), ".");
|
final String dir = StrUtil.defaultIfEmpty(StrUtil.removeSuffix(path, fileName), ".");
|
||||||
|
// issue#I7CSQ9 检查父目录为目录且是否存在
|
||||||
|
if(!isDir(dir)){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
final List<String> names;
|
final List<String> names;
|
||||||
try {
|
try {
|
||||||
names = ls(dir);
|
names = ls(dir);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user