RFR: 8350880: (zipfs) Add support for read-only zip file systems [v3]

David Beaumont duke at openjdk.org
Mon May 12 20:15:52 UTC 2025


On Mon, 12 May 2025 16:04:22 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> David Beaumont has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Fix comment based on current behaviour.
>
> src/jdk.zipfs/share/classes/module-info.java line 281:
> 
>> 279:  *       Even if a zip file system is writable ({@code fs.isReadOnly() == false}),
>> 280:  *       this says nothing about whether individual files can be created or
>> 281:  *       modified, simply that it might be possible.
> 
> Initially I thought this was to allow for POSIX file permissions but not sure after reading it a second time. Can you say if this is what you mean?

Hmm, you're right, it's not totally clear. It's trying to draw the same sort of distinction that you have with mounted file systems, in which the mode that something is mounted in doesn't override any underlying read-only state.

For example you can still open a ZipFileSystem for a ZIP file which is on a remote drive, where the permissions show the underlying file as "writable", but an attempt to modify the contents would still fail.

The POSIX stuff is mentioned at the end, and while it's related, it's not quite the same point.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/25178#discussion_r2085372871


More information about the nio-dev mailing list