Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.8, 1.9, 1.20
-
None
-
None
Description
When creating a zip file using ZipArchiveOutputStream(File) constructor each entry get an extra `Zip64ExtendedInformationExtraField` header which shouldn't be there.
The issue can be reproduced using below code sample
public static void main(String[] args) throws IOException { // Create file final File file = File.createTempFile("apache_", ".zip"); try ( ZipArchiveOutputStream zos = new ZipArchiveOutputStream(file)) { zos.putArchiveEntry(new ZipArchiveEntry("TextFile1.txt")); zos.closeArchiveEntry(); } // List Headers File final ZipFile zipFile = new ZipFile(file); final Enumeration<? extends ZipArchiveEntry> entries = zipFile.getEntries(); while (entries.hasMoreElements()) { final ZipArchiveEntry entry = entries.nextElement(); for (ZipExtraField zipExtraField : entry.getExtraFields()) { System.out.println("EntryName:" + entry.getName() + " Header: "+ zipExtraField.getHeaderId().getValue()); // Header shouldn't be present. } } }