Review Request: JDK-7142921,(fs) Files.probeContentType reports a MIME type of "text/plain" on Ubuntu 11.04
Alan.Bateman at oracle.com
Tue Nov 27 04:39:24 PST 2012
On 27/11/2012 00:53, Dan Xu wrote:
> I have added a comment to UnixFileSystemProvider.chain and remove its
> "protected" keyword. The new webrev is at,
> http://cr.openjdk.java.net/~dxu/7142921/webrev.01/. Thanks!
I've looked at the libmagic based FileTypeDetector and it looks good.
From the man page, it looks like magic_file will return NULL if it
can't open the file, in which case you might not need to test if the
file exists. A couple of minor comments:
- the function prototype for magic_open uses "flag" but "flags" would be
- in initialize0 you can move the second magic_handle == NULL into the
previous statement to avoid checking it twice.
- in MagicFileTypeDetector then you shouldn't need to call super explicitly.
I still have on my list to review the mime.types FileTypeDetector,
hopefully find time soon. I'm sure others can help review that one too.
More information about the nio-dev