JDK-8039362 : Read content-types.properties as a resource
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 9
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2014-04-07
  • Updated: 2017-05-17
  • Resolved: 2014-04-15
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 b10Fixed
Related Reports
Relates :  
Relates :  
Sub Tasks
JDK-8175295 :  
Description
This bug asks to examine ${java.home}/lib/content-types.properties to see whether it can be loaded as a resources file, from resources.jar. This follows JDK-8004963: "URLConnection, downgrade normative reference to ${java.home}/lib/content-types.properties".

The motive for this bug is the modular JDK where we need the flexibility to put anything that is module-private into a module-private location. In this case it would appear that the above files are not a supported interface and so should move to a location that should be read as resources. 
Comments
A user-specific content-type table can be set through the `content.types.user.table` system property. The value should be a file path. The file should contain a list of java.util.Properties. The property key is the content/MIME type. The property value is a semicolon separated list of fields, as described below. Property fields: <description> ::= 'description' '=' <descriptive string> <extensions> ::= 'file_extensions' '=' <comma-delimited list, include '.'> <image> ::= 'icon' '=' <filename of icon image> <action> ::= 'browser' | 'application' | 'save' | 'unknown' <application> ::= 'application' '=' <command line template> For example text/plain: \ description=Plain Text;\ file_extensions=.text,.txt,.java,;\ icon=text;\ action=browser
25-04-2017

Added 'noreg-other', existing regression tests in jdk/test/java/net/URLConnection exercise this area.
15-04-2014