Skip to content

Commit

Permalink
fix skipping dirs
Browse files Browse the repository at this point in the history
  • Loading branch information
EpicPlayerA10 committed Jan 13, 2025
1 parent a093be1 commit a87781c
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,14 @@ public static void loadFilesFromZip(Path path, BiConsumer<String, byte[]> consum

while (it.hasNext()) {
JarEntry zipEntry = it.next();
if (zipEntry.isDirectory()) continue;

String name = zipEntry.getName();
byte[] bytes = zipFile.getInputStream(zipEntry).readAllBytes();

// Skip directories
boolean isDirectory = zipEntry.isDirectory() && bytes.length == 0;
if (isDirectory) continue;

CompletableFuture<Void> future = CompletableFuture.runAsync(() -> {
try {
consumer.accept(name, bytes);
Expand Down

0 comments on commit a87781c

Please sign in to comment.