My Zip File structure is something like this:
t1.zip
--> t2.zip
--> sample.txt
I want to replace sample.txt. If it's one level, I was able to do it. Please help me with multi level nested zip files.
My Sample Code
ZipFile zipFile = new ZipFile(new File("t1.zip");
ZipArchiveEntry ze = zipFile.getEntry("t2.zip"); // So It works fine
I tried
ZipArchiveEntry ze = zipFile.getEntry("t2.zip/sample.txt"); // returns null
My intention was to follow Example from the apache's documentation page as this
ZipArchiveEntry entry = new ZipArchiveEntry(new File("sample.txt")); // Should I t2.zip/sample.txt ?
entry.setSize(size);
zipOutput.putArchiveEntry(entry);
zipOutput.write(contentOfEntry);
zipOutput.closeArchiveEntry();
But I am not clear, how to put the archive entry 2 level inside ?