Review Request: JDK-7142921,(fs) Files.probeContentType reports a MIME type of "text/plain" on Ubuntu 11.04

Dan Xu dan.xu at oracle.com
Fri Nov 30 08:28:56 PST 2012


Thanks for your comments. Here is the updated patch, 
http://cr.openjdk.java.net/~dxu/7142921/webrev.03/ 
<http://cr.openjdk.java.net/%7Edxu/7142921/webrev.03/>. Please review it.

-Dan


On 11/29/2012 09:54 AM, Alan Bateman wrote:
> On 29/11/2012 07:45, Dan Xu wrote:
>> I have updated my fix accordingly and uploaded it to webrev at 
>> http://cr.openjdk.java.net/~dxu/7142921/webrev.02/. Please take a 
>> review. Thanks!
>>
>> -Dan
> Thanks for the update.
>
> I see you've removed the protected constructors from Abstract* and the 
> public constructors from *FileSystemProvider, I assume you didn't mean 
> to do that.
>
> In the getFileSystemDetector methods then I assume that 
> System.getProperty("user.name") needs to be done in a privileged 
> block, otherwise Files.probeContentType will not work with a security 
> manager.
>
> I think the MagicFileTypeDetector looks fine.
>
> MimeTypesFileTypeDetector looks better now that it encapsulates just 
> one mime.types files. I think it needs a bit of clean-up though, the 
> main issues seems to be that loadMimeTypes is not synchronized and 
> there are several potential problems if implProbeContentType is 
> invoked by more than one thread at around the same time. Also point is 
> that the previous mails I thought that testing the extension would be 
> case sensitive only on Linux and Solaris.
>
> So overall I think we are a step closer on this.
>
> -Alan.
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20121130/38ce02fe/attachment.html 


More information about the nio-dev mailing list