refactor: move validatePathIsMember logic to NIO files API

This commit is contained in:
Christian Bergschneider committed 2026-05-28 20:57:17 +02:00
1 parent 4f59ca4f99
commit 8f1a53fc2a
2 files changed
+2 -4

No files matched your search

@@ -68,8 +68,7 @@ public class ConfigRegistry extends OpenRegistryImpl<ConfigPack> implements Exte
@Override
public boolean validatePathIsMember(Path path) {
var file = path.toFile();
return file.isDirectory() || file.getName().endsWith(".zip");
return Files.isDirectory(path)|| path.getFileName().endsWith(".zip");
}
public static class PackLoadFailuresException extends Exception {
@@ -68,7 +68,6 @@ public class MetaConfigRegistry extends OpenRegistryImpl<MetaPack> implements Ex
@Override
public boolean validatePathIsMember(Path path) {
var file = path.toFile();
return file.isDirectory() || file.getName().endsWith(".zip");
return Files.isDirectory(path) || path.getFileName().endsWith(".zip");
}
}