Review Request: JDK-7142921,(fs) Files.probeContentType reports a MIME type of "text/plain" on Ubuntu 11.04
Alan Bateman
Alan.Bateman at oracle.com
Thu Nov 29 09:54:54 PST 2012
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/20121129/51e9161d/attachment.html
More information about the nio-dev
mailing list