JDK-8129633 : (fs) Investigate removing the GNOME-based FileTypeDetector from the Linux and Solaris implementations
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.nio
  • Affected Version: 9
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: linux,solaris
  • Submitted: 2015-06-23
  • Updated: 2016-09-07
  • Resolved: 2015-08-06
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b77Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
The GnomeFileTypeDetector uses the GNOME I/O library if available with fallback to the GNOME VFS, which is deprecated. The MagicFileTypeDetector is superior on Linux (libmagic is used by the 'file' command). On Solaris however if GnomeFileTypeDetector were removed the implementation would depend entirely on ~/.mime.types and /etc/mime.types which are not guaranteed to be present so this could be problematic.
Comments
Review thread: http://mail.openjdk.java.net/pipermail/nio-dev/2015-August/003252.html
06-08-2015

A couple of tests were conducted which attempt to probe the content type of files ending in several common file extensions: jpg, mp3, mp4, pdf, and png. The tests involved using two modified versions of GnomeFileTypeDetector: one with only the GIO probe enabled, and the other with both the GIO and GNOME VFS probes disabled, i.e., the file detector becomes a no-op. In the case of GIO-only, on Linux and Solaris, all the listed extensions were mapped to the correct content types: image/jpeg, audio/mpeg, video/mpeg, application/pdf, and image/png, respectively. With both GIO and GNOME VFS probes disabled, on Linux the mp4 was not mapped to the expected content type, and on Solaris none of the extensions was mapped to its corresponding content type. The foregoing results tend to support the removal of the GNOME VFS code in this FileDetector, and perhaps renaming GnomeFileTypeDetector to GIOFileTypeDetector (Java and C files).
26-06-2015