I have a very large volume of data and I need to upload it to github. So i decided to use splitted zip files and have the program merge them and then unzip them.
private static void mergeSplitFiles(String path) {
System.out.println("Merging data from: " + path);
try {
ZipFile zip = new ZipFile(path + "/train.zip");
zip.mergeSplitFiles(new File(ORIGINAL_DATA + ".zip"));
} catch (ZipException e) {
e.printStackTrace();
}
}
The merging seems great but then I tried decompressing like this:
private static void uncompressData(String path) {
System.out.println("Uncompressing data from: " + path);
new File(path).mkdir();
try {
ZipFile zip = new ZipFile(path + ".zip");
zip.extractAll(path);
} catch (ZipException e) {
e.printStackTrace();
}
}
This code worked for manually compressed data, but fails with merged one.
Tried to manually uncompress the merged file and it crashes giving me an error halfway. I'm using the latest version in maven:
<dependency>
<groupId>net.lingala.zip4j</groupId>
<artifactId>zip4j</artifactId>
<version>2.6.1</version>
</dependency>
The error im getting is this:
net.lingala.zip4j.exception.ZipException: Could not read corresponding local file header for file header: 2964082/61083998.txt
Cant find anything