zipfs - create = true should create parent dirs too?

Jaikiran Pai jai.forums2013 at
Fri Nov 22 16:09:18 UTC 2019

On 22/11/19 5:46 PM, Alan Bateman wrote:
> On 22/11/2019 12:10, Jaikiran Pai wrote:
>> The ZipFileSystemProvider states in this doc[1] that the "create"
>> property with a value "true", creates the zip file if it's not present,
>> when FileSystems.newFileSystem the API is used. However, it doesn't say
>> anything about the parent directories of the Path that's passed as the
>> zip file path. Imagine something like /tmp/non-existent/newzip.jar as
>> the Path that gets passed to the FileSystems.newFileSystem with "create"
>> = "true". What's the expected semantics here for zipfs? Should it be
>> expected to even create the non-existent parent dir(s)?
>> Right now, the implementation fails with a NoSuchFileException due to
>> the missing parent dir.
> It should only attempt to create the zip file, not the directories.
Thank you Alan.

>> On a related note, is there any public documentation of zipfs and its
>> properties post Java 8 release? I couldn't find anything in the javadocs
>> or other places for this.
> The documentation is in the the jdk.zipfs module description, which of
> course didn't exist in JDK 8. The docs have been expanding and
> improvement in recent time, here's the latest for jdk-14+24:

This indeed is much improved.


More information about the nio-dev mailing list