-
Bug
-
Resolution: Cannot Reproduce
-
P3
-
None
-
8
-
None
Unit test:
public class ZipCloneTest {
public static void main(String[] args) throws IOException {
Map<String, Object> env = new HashMap<>();
env.put("encoding", "utf-8");
env.put("create", "true");
// create a source zip file abc.jar
Path file = Paths.get("abc.jar");
java.nio.file.Files.deleteIfExists(file);
URI uri = URI.create("jar:" + file.toUri().toString());
ZipFileSystem fs = (ZipFileSystem) FileSystems.newFileSystem(uri, env, null);
Path p = fs.getPath("/");
java.nio.file.Files.createFile(p.resolve("1.txt"));
fs.close();
Map<String, Object> env2 = new HashMap<>();
env2.put("encoding", "utf-8");
ZipFileSystem fs2 = (ZipFileSystem) FileSystems.newFileSystem(uri, env2, null);
Path p2 = fs2.getPath("/1.txt");
// copy files of abc.jar into def.jar
Path file3 = Paths.get("def.jar");
java.nio.file.Files.deleteIfExists(file3);
URI uri3 = URI.create("jar:" + file3.toUri().toString());
ZipFileSystem fs3 = (ZipFileSystem)FileSystems.newFileSystem(uri3, env, null);
Path p3 = fs3.getPath("/").resolve("3.txt");
java.nio.file.Files.copy(p2, p3);
fs3.close();
fs2.close();
}
}
Expected:
test passed without exception
Actual:
Exception in thread "main" java.io.EOFException: Unexpected end of ZLIB input stream
at com.sun.nio.zipfs.ZipFileSystem$5.fill(ZipFileSystem.java:1427)
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
at java.io.FilterInputStream.read(FilterInputStream.java:107)
at com.sun.nio.zipfs.ZipPath.copyToTarget(ZipPath.java:858)
at com.sun.nio.zipfs.ZipPath.copy(ZipPath.java:817)
at com.sun.nio.zipfs.ZipFileSystemProvider.copy(ZipFileSystemProvider.java:194)
at java.nio.file.Files.copy(Files.java:1234)
at ZipCloneTest.main(ZipCloneTest.java:34)
Java Result: 1
public class ZipCloneTest {
public static void main(String[] args) throws IOException {
Map<String, Object> env = new HashMap<>();
env.put("encoding", "utf-8");
env.put("create", "true");
// create a source zip file abc.jar
Path file = Paths.get("abc.jar");
java.nio.file.Files.deleteIfExists(file);
URI uri = URI.create("jar:" + file.toUri().toString());
ZipFileSystem fs = (ZipFileSystem) FileSystems.newFileSystem(uri, env, null);
Path p = fs.getPath("/");
java.nio.file.Files.createFile(p.resolve("1.txt"));
fs.close();
Map<String, Object> env2 = new HashMap<>();
env2.put("encoding", "utf-8");
ZipFileSystem fs2 = (ZipFileSystem) FileSystems.newFileSystem(uri, env2, null);
Path p2 = fs2.getPath("/1.txt");
// copy files of abc.jar into def.jar
Path file3 = Paths.get("def.jar");
java.nio.file.Files.deleteIfExists(file3);
URI uri3 = URI.create("jar:" + file3.toUri().toString());
ZipFileSystem fs3 = (ZipFileSystem)FileSystems.newFileSystem(uri3, env, null);
Path p3 = fs3.getPath("/").resolve("3.txt");
java.nio.file.Files.copy(p2, p3);
fs3.close();
fs2.close();
}
}
Expected:
test passed without exception
Actual:
Exception in thread "main" java.io.EOFException: Unexpected end of ZLIB input stream
at com.sun.nio.zipfs.ZipFileSystem$5.fill(ZipFileSystem.java:1427)
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
at java.io.FilterInputStream.read(FilterInputStream.java:107)
at com.sun.nio.zipfs.ZipPath.copyToTarget(ZipPath.java:858)
at com.sun.nio.zipfs.ZipPath.copy(ZipPath.java:817)
at com.sun.nio.zipfs.ZipFileSystemProvider.copy(ZipFileSystemProvider.java:194)
at java.nio.file.Files.copy(Files.java:1234)
at ZipCloneTest.main(ZipCloneTest.java:34)
Java Result: 1
- relates to
-
JDK-7012856 (zipfs) Newly created entry in zip file system should set all file times non-null values.
-
- Closed
-