Makes extension check case insensitive

This commit is contained in:
Kristian Knarvik 2023-08-31 03:03:59 +02:00
parent 56f5e31934
commit f81a21b9e9

View File

@ -52,7 +52,7 @@ public final class FileUtil {
} }
//Get a list of all files which are folders and has one of the extensions specified //Get a list of all files which are folders and has one of the extensions specified
File[] foundFiles = folder.listFiles((file) -> file.isFile() && File[] foundFiles = folder.listFiles((file) -> file.isFile() &&
ListUtil.listContains(extensions, (item) -> file.getName().endsWith(item))); ListUtil.listContains(extensions, (item) -> file.getName().toLowerCase().endsWith(item)));
//Return if recursion is finished //Return if recursion is finished
if (maxRecursions == 1) { if (maxRecursions == 1) {
return foundFiles; return foundFiles;