Bundled zip FileSystemProvider fails to recognize "readonly"?
Martin Buchholz
martinrb at google.com
Tue Apr 21 20:17:46 UTC 2015
It seems "obvious" that file system implementations should have options for
read-only access, mirroring the readonly options from mount(8).
For existing zip files, one almost always wants to open them read-only.
New zip files are almost always rewritten from scratch.
On Tue, Apr 21, 2015 at 9:26 AM, Francis Galiegue <fgaliegue at gmail.com>
wrote:
> On Tue, Apr 21, 2015 at 6:12 PM, Alan Bateman <Alan.Bateman at oracle.com>
> wrote:
> > On 17/04/2015 16:24, Francis Galiegue wrote:
> >>
> >> :
> >> OK... But I believe it would be a nice option to have. Would such a
> >> feature request be considered at all?
> >>
> > No objection but I wonder if it is would be used. Are you looking for
> this
> > specifically for the zip provider or thinking about an equivalent with
> > another provider?
> >
>
> That is a good question... And which I believe is somewhat related to
> the usage of JSR 203 today. And that is still, unfortunately, very
> little.
>
> And I am certainly not a "guinea pig" for a casual user since I
> implemented a couple of FileSystems myself. Anyway, in this package
> (https://github.com/fge/java7-fs-more), I have implemented a
> MoreFileSystems.openZip(path, boolean), which, if the second argument
> is true ("read only, please"), wraps the JRE provided
> FileSystemProvider and FileSystem with "read only" versions (that is,
> throw ReadOnlyFileSystemException on any write attempt).
>
> Notwithstanding the "shortcuts" made available (that is: open a
> FileSystem over the zip; then wrap it read only if requested), I
> believe it would be a nice addition to the standard API to provide a
> way to do this, as in:
>
> FileSystems.newReadOnlyFileSystem(uri, env)
>
> or the like.
>
> --
> Francis Galiegue, fgaliegue at gmail.com, https://github.com/fge
> JSON Schema in Java: http://json-schema-validator.herokuapp.com
> Parsers in pure Java: https://github.com/fge/grappa
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20150421/a07ffed3/attachment.html>
More information about the nio-dev
mailing list