RFR JDK-8002390 problems moving files between zip file systems
mark.sheppard at oracle.com
Thu Feb 14 18:34:35 UTC 2013
Please oblige and review the webrev at
which addresses the issue raised in JDK-8002390
Description: While working with the new ZipFileSystem to modify the
contents of a zip file, encountered some issues.
The issue occurs when a file within a zip file is moved to a different
location within the same zip and a FileVisitor is invoked by
Files.walkFileTree the original (no longer existing file) will attempted
to be visited by ZipFileSystemProvider and throw a NoSuchFileException.
This is an issue with the ZipFileSystem demonstration code, which
provides a concrete example of the java.nio.file FileSystem and
The issue arises when the file system is created, closed, then re-opened
a file move operation within the ZipFileSystem.
This arises from the fact that the internal data structures representing
when it is initially created are slightly different to those when the
file system is re-opened after a close.
The ZipFileSystem.copyFile() processing flow, which is the end result of
needed to be amended to allow for this subtle difference. This is
represented in the changes in the update() and
removeFromTree() methods. Additionally, the logic for handling a rename,
earlier in the processing
flow was amended, also.
relevant tests have been updated.
More information about the core-libs-dev