Empty jar check???? sure why not

This commit is contained in:
Ivan Pekov 2021-10-28 20:00:03 +03:00
parent f1de7d058a
commit d072c14843
No known key found for this signature in database
GPG Key ID: E44CE4557A5E12E0

View File

@ -45,6 +45,9 @@ public class FileUtil {
JarFile jar = new JarFile(file);
Enumeration<? extends ZipEntry> entries = jar.entries();
if (!entries.hasMoreElements()) {
return null;
}
List<Class<? extends T>> classes = new ArrayList<>();
try (URLClassLoader loader =
new URLClassLoader(new URL[] {file.toURI().toURL()}, clazz.getClassLoader())) {