fix file browser suffix bug

This commit is contained in:
ShirosakiMio 2024-02-16 16:35:14 +08:00
parent e7567f9a0c
commit d2b5d814f4
1 changed files with 4 additions and 6 deletions

View File

@ -31,16 +31,14 @@ public class FileOperator {
List<File> filterList = new ArrayList<>();
if (fileBrowser.getSuffix().size() > 0) {
for (File file : rawList) {
boolean add = false;
if (file.isFile()) {
for (String suffix : fileBrowser.getSuffix()) {
add = file.getAbsolutePath().endsWith(suffix);
break;
if (file.getName().endsWith(suffix)) {
filterList.add(file);
break;
}
}
} else {
add = true;
}
if (add) {
filterList.add(file);
}
}