Replacing default FileSystemProvider
Michael Hall
mik3hall at gmail.com
Sun Mar 21 08:35:08 UTC 2021
> On Mar 21, 2021, at 3:14 AM, Alan Bateman <Alan.Bateman at oracle.com> wrote:
>
> On 20/03/2021 23:30, Michael Hall wrote:
>> :
>> The idea wasn’t to completely replace the default ‘file’ provider but to expose some native API’s through nio attributes. The main use I am remembering. For other purposes it served as a passthrough to the usual default.
>>
>> So for the FileManager replacement that was being discussed earlier there could be…
>>
>> Files.setAttribute(p, "mac_finder:type", new String(b));
>> pokeInt(b,0,creator);
>> Files.setAttribute(p, "mac_finder:creator", new String(b));
>>
>> mac_finder would be the API concerned followed by the attribute.
>> I had attributes for 3 or 4 native API’s.
> Maybe I have this wrong but I thought that the type/creator codes have been obsolete for more than 10 years. That is, I think macOS ignores them but maybe are working with programs that still use them?
>
> I did a quick test with SetFile/GetFile (these programs are deprecated but are still included with Xcode) and I see that they are storing the codes in an extended attribute named "com.apple.FinderInfo". If you know the format then it means they you should be able to use the UserFileAttributeView to access them (Sebastian Stenzel did great work to implement this attribute view on macOS recently).
>
> -Alan.
It’s been a while since I looked at any of this. I believe the mac_finder API corresponded to the old Carbon File stuff. It is still there if used much currently or not. It is/was supported by the com.apple.eio.FileManager class so it made sense there.
So far I haven’t been able to duplicate the error with the simple test case. The error does appear to begin right after 1.8 at java 9.
It seems similar to these issues…
https://bugs.openjdk.java.net/browse/JDK-8058876 <https://bugs.openjdk.java.net/browse/JDK-8058876>. Overriding the default file system provider fails with a modular image
https://bugs.openjdk.java.net/browse/JDK-8059939 <https://bugs.openjdk.java.net/browse/JDK-8059939>. java/nio/file/spi/SetDefaultProvider.java fails with modular image
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20210321/0d2fd922/attachment.htm>
More information about the nio-dev
mailing list