This might repair Zip problems such as #31
parent
64bc52c77f
commit
2c3c972324
|
@ -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,16 +41,16 @@ 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);
|
||||||
scatterZipCreator.addArchiveEntry(entry, supplier);
|
scatterZipCreator.addArchiveEntry(entry, supplier);
|
||||||
});
|
});
|
||||||
|
|
||||||
scatterZipCreator.writeTo(arc);
|
scatterZipCreator.writeTo(arc);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue