|
@@ -294,11 +294,11 @@ public class Ftp extends AbstractFtp {
|
|
|
return ListUtil.empty();
|
|
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;
|
|
String fileName;
|
|
|
for (FTPFile ftpFile : ftpFiles) {
|
|
for (FTPFile ftpFile : ftpFiles) {
|
|
|
fileName = ftpFile.getName();
|
|
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)) {
|
|
if (null == filter || filter.accept(ftpFile)) {
|
|
|
result.add(ftpFile);
|
|
result.add(ftpFile);
|
|
|
}
|
|
}
|