This might repair Zip problems such as #31

2.x-1.16
szymon 2020-08-02 11:09:08 +02:00
parent 64bc52c77f
commit 2c3c972324
1 changed files with 10 additions and 11 deletions

View File

@ -11,7 +11,6 @@ import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.concurrent.*; import java.util.concurrent.*;
import java.util.stream.Collectors;
import java.util.zip.ZipEntry; import java.util.zip.ZipEntry;
/* /*
@ -42,11 +41,11 @@ public class ParallelZipCompressor {
File input = in.getCanonicalFile(); File input = in.getCanonicalFile();
Files.walk(input.toPath() Files.walk(input.toPath())
).filter(path -> !path.equals(input.toPath()) && .filter(path -> !path.equals(input.toPath()))
path.toFile().isFile() && .filter(path -> path.toFile().isFile())
!Utilities.isBlacklisted(input.toPath().relativize(path)) .filter(path -> !Utilities.isBlacklisted(input.toPath().relativize(path)))
).collect(Collectors.toList()).parallelStream().forEach(p -> { .forEach(p -> {
ZipArchiveEntry entry = new ZipArchiveEntry(input.toPath().relativize(p).toString()); ZipArchiveEntry entry = new ZipArchiveEntry(input.toPath().relativize(p).toString());
entry.setMethod(ZipEntry.DEFLATED); entry.setMethod(ZipEntry.DEFLATED);
FileInputStreamSupplier supplier = new FileInputStreamSupplier(p); FileInputStreamSupplier supplier = new FileInputStreamSupplier(p);