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

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

Thanks for your comments. Here is the updated patch, 
<>. Please review it.


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 
>> 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("") 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...

More information about the nio-dev mailing list