Use stream instead of for loop

This commit is contained in:
szymon 2021-07-07 14:21:49 +02:00
parent a0c7b478cb
commit 8858bd498b

View File

@ -92,9 +92,7 @@ public class Utilities {
if (path.getFileName().toString().equals("session.lock")) return true;
}
for(String i : config.get().fileBlacklist) if(path.startsWith(i)) return true;
return false;
return config.get().fileBlacklist.stream().anyMatch(path::startsWith);
}
public static Optional<ConfigPOJO.ArchiveFormat> getArchiveExtension(String fileName) {