private void testSevenZArchiveCreation(SevenZMethod method) throws Exception {
final File output = new File(dir, "bla.7z");
final File file1 = getFile("test1.xml");
final File file2 = getFile("test2.xml");
final SevenZOutputFile outArchive = new SevenZOutputFile(output);
outArchive.setContentCompression(method);
try {
SevenZArchiveEntry entry;
entry = outArchive.createArchiveEntry(file1, file1.getName());
outArchive.putArchiveEntry(entry);
copy(file1, outArchive);
outArchive.closeArchiveEntry();
entry = outArchive.createArchiveEntry(file2, file2.getName());
outArchive.putArchiveEntry(entry);
copy(file2, outArchive);
outArchive.closeArchiveEntry();
} finally {
outArchive.close();
}
final SevenZFile archive = new SevenZFile(output);
try {
SevenZArchiveEntry entry;