private void removeEntriesFoundInZipFile(final File result, final Map<String, byte[]> entries) throws IOException {
final ZipFile zf = new ZipFile(result);
final Enumeration<ZipArchiveEntry> entriesInPhysicalOrder = zf.getEntriesInPhysicalOrder();
while (entriesInPhysicalOrder.hasMoreElements()){
final ZipArchiveEntry zipArchiveEntry = entriesInPhysicalOrder.nextElement();
final InputStream inputStream = zf.getInputStream(zipArchiveEntry);
final byte[] actual = IOUtils.toByteArray(inputStream);
final byte[] expected = entries.remove(zipArchiveEntry.getName());
assertArrayEquals( "For " + zipArchiveEntry.getName(), expected, actual);
}
zf.close();
}
|