-
Enhancement
-
Resolution: Won't Fix
-
P4
-
None
-
11, 17, 21, 23
-
generic
-
generic
ADDITIONAL SYSTEM INFORMATION :
Windows 11
A DESCRIPTION OF THE PROBLEM :
When a zip file from dropbox is read/extracted using java.util.zip.ZipInputStream, you get the following exception:
```
java.util.zip.ZipException: only DEFLATED entries can have EXT descriptor
at java.base/java.util.zip.ZipInputStream.readLOC(ZipInputStream.java:529)
at java.base/java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:153)
at my.namespace.JavaZipper.unzipFile(JavaZipper.java:111)
```
Here is a simple reproducer:
```
@Test
public static void TestUnzip() throws FileNotFoundException, IOException {
var inputZipFile = new File("C:\\my\\path\\src\\file.zip");
var outputPathStr = "C:\\my\\path\\dest";
try(ZipInputStream zipStreamIn = new ZipInputStream(new FileInputStream(inputZipFile))) {
ZipEntry zipEntry = null;
while((zipEntry = zipStreamIn.getNextEntry()) != null) {
final String entryName = zipEntry.getName().replace("/", "\\"); // normalise path (windows-format)
// ignore directories
if(zipEntry.isDirectory())
continue;
// prepare destination path
File targetFile = new File( outputPathStr + "\\" + entryName );
targetFile.getParentFile().mkdirs();
// zip stream to file
System.out.println("Extract File: " + entryName);
try(var zipStreamOut = new FileOutputStream(targetFile)) {
zipStreamIn.transferTo(zipStreamOut);
}
}
}
}
```
All commonly used zipper tools are able to extract such files (with EXT descriptor), hence it would be very useful if the Java Runtime could do the same.
Windows 11
A DESCRIPTION OF THE PROBLEM :
When a zip file from dropbox is read/extracted using java.util.zip.ZipInputStream, you get the following exception:
```
java.util.zip.ZipException: only DEFLATED entries can have EXT descriptor
at java.base/java.util.zip.ZipInputStream.readLOC(ZipInputStream.java:529)
at java.base/java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:153)
at my.namespace.JavaZipper.unzipFile(JavaZipper.java:111)
```
Here is a simple reproducer:
```
@Test
public static void TestUnzip() throws FileNotFoundException, IOException {
var inputZipFile = new File("C:\\my\\path\\src\\file.zip");
var outputPathStr = "C:\\my\\path\\dest";
try(ZipInputStream zipStreamIn = new ZipInputStream(new FileInputStream(inputZipFile))) {
ZipEntry zipEntry = null;
while((zipEntry = zipStreamIn.getNextEntry()) != null) {
final String entryName = zipEntry.getName().replace("/", "\\"); // normalise path (windows-format)
// ignore directories
if(zipEntry.isDirectory())
continue;
// prepare destination path
File targetFile = new File( outputPathStr + "\\" + entryName );
targetFile.getParentFile().mkdirs();
// zip stream to file
System.out.println("Extract File: " + entryName);
try(var zipStreamOut = new FileOutputStream(targetFile)) {
zipStreamIn.transferTo(zipStreamOut);
}
}
}
}
```
All commonly used zipper tools are able to extract such files (with EXT descriptor), hence it would be very useful if the Java Runtime could do the same.
- relates to
-
JDK-8143613 Modify ZipInputStream to support later PKZIP standards.
- Closed