I would like to preview the content of a .7z without extracting it with Java, so i tried with Apache Commons Compress :
public static void main(String[] args) {
try {
SevenZFile sevenZFile = new SevenZFile(new File("C://test.7z"));
SevenZArchiveEntry entry;
while ((entry = sevenZFile.getNextEntry()) != null) {
System.out.println("Name: " + entry.getName());
System.out.println("Size : " + entry.getSize());
System.out.println("--------------------------------");
}
} catch (Exception e) {
e.printStackTrace();
}
}
It works but i would like to also preview files into an other 7z or zip from the original 7z :
test.7z
--- file1.txt
--- otherInner.7z
---- innerFile1.txt
---- innerFile2.txt
Is there a mean to do that without extracting the 7z ? Thanks for your help.