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

Alan Bateman Alan.Bateman at
Tue Nov 27 04:39:24 PST 2012

On 27/11/2012 00:53, Dan Xu wrote:
> Hi,
> I have added a comment to UnixFileSystemProvider.chain and remove its 
> "protected" keyword. The new webrev is at, 
> Thanks!
> -Dan
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 
more correct.

- 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 mailing list