JDK 9 RFR of 8146215: (fs) java/nio/file/Files/probeContentType/Basic.java failed frequently on Solaris-sparc with Unexpected type: text/plain

Brian Burkhalter brian.burkhalter at oracle.com
Tue Aug 2 14:59:43 UTC 2016


On Aug 2, 2016, at 7:36 AM, Alan Bateman <Alan.Bateman at oracle.com> wrote:

> On 01/08/2016 15:11, Brian Burkhalter wrote:
>> 
>> Modified accordingly: http://cr.openjdk.java.net/~bpb/8146215/webrev.02/
> There is a still a volatile write to initialize fileNameMap to null at L38, this can be removed.

Will do.

>> 
>>> Alternatively just call URLConnection.getFileNameMap() each time.
>> 
>> URLConnection.getFileNameMap() is synchronized and returns a new anonymous class instance at each invocation so this does not look to be a good idea.
> I meant that we clean-up URLConnection.getFileNameMap().

I can look into that.

>> 
>>> As regards ordering what what you have it okay. I assume it will be rare to set the property content.types.user.table and so the JDK's content-types.properties will be a fallback.
>> 
>> Question is whether this should be a fallback on OS X and Windows as well.
>> 
> On Windows then it's configured via the UI (backed by the registry) so probably not needed.

Based on a test run the registry detector does not recognize for example the basic extensions mp3, mp4, nor pdf.

> On OSX then then can the mappings that the UTI based detector uses be configured?

Yes [1].

Brian

[1] https://developer.apple.com/library/mac/documentation/FileManagement/Conceptual/understanding_utis/understand_utis_declare/understand_utis_declare.html#//apple_ref/doc/uid/TP40001319-CH204-SW1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20160802/8af6c02f/attachment.html>


More information about the nio-dev mailing list