RFR 8229888: Zip FS does not retain permissions when updating a Zip file
Alan Bateman
Alan.Bateman at oracle.com
Wed Dec 4 09:11:35 UTC 2019
On 03/12/2019 23:45, Lance Andersen wrote:
> Did you mean: Files.getPosixFilePermissions
Yes, there was a typo in my mail.
> :
>
> Would the following be more efficient than catching the IOE as I saw
> it used in TempFileHelper:
>
> --------
> boolean isPosix =
> FileSystems.getDefault().supportedFileAttributeViews().contains("posix");
> --------
Yes, that also avoids needing to be concerned with the FileStore.
> :
>
> If I am understanding this suggestion, it would be to modify the call
> to Files.createTempFile in the method createTempFileinSameDirectoryAs
> to pass the original zip file permissions as an file attribute ?
Yes, although you will be restricted by the umask so you could end up
with less permissions that the original zip file. Anyway, I just wanted
to mention it as alternative ways that you could explore to avoid
interacting with the underlying FileStore as I suspect that will be
problematic in some environments.
-Alan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20191204/6e8c2785/attachment.html>
More information about the nio-dev
mailing list