mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-05 17:37:59 +08:00
fix ftpFiles length Exception
This commit is contained in:
parent
a0f5970037
commit
c0c3395296
@ -294,11 +294,11 @@ public class Ftp extends AbstractFtp {
|
||||
return ListUtil.empty();
|
||||
}
|
||||
|
||||
final List<FTPFile> result = new ArrayList<>(ftpFiles.length - 2);
|
||||
final List<FTPFile> result = new ArrayList<>(ftpFiles.length - 2 <= 0 ? ftpFiles.length : ftpFiles.length - 2);
|
||||
String fileName;
|
||||
for (FTPFile ftpFile : ftpFiles) {
|
||||
fileName = ftpFile.getName();
|
||||
if (false == StrUtil.equals(".", fileName) && false == StrUtil.equals("..", fileName)) {
|
||||
if (!StrUtil.equals(".", fileName) && !StrUtil.equals("..", fileName)) {
|
||||
if (null == filter || filter.accept(ftpFile)) {
|
||||
result.add(ftpFile);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user