Does OpenJDK support bitmap image with JarURLConnection?

Chris Hegarty chris.hegarty at oracle.com
Tue Mar 1 02:44:47 PST 2011


Interesting... I would have guessed bmp would be supported too.  It
doesn't appear to be specific to JarURLConnection, raw file urls also
exhibit the same behavior.

Wow, last time content-types.properties was meaningfully changed was
1999, when PNG was added! I don't have any specific objection to adding it.

-Chris.


On 03/ 1/11 09:27 AM, Jing LV wrote:
> Hello,
> 
> It is a little odd to me that I find OpenJDK JarURLConnection does not
> support bmp file. The testcase below:
> 
> public static void main(String[] args) throws MalformedURLException, IOException {
>          JarURLConnection conn = (JarURLConnection) new URL("jar:file:/somedir/somejar.jar!/somebmp.bmp").openConnection();
>          System.out.printf("Returned type for the entry should be the known type " +
>                  "image/bmp, but it is " + conn.getContentType());
>      }
> 
>      (Need create a somejar.jar containing a bmp file named somebmp.bmp)
> 
>      It should return image/bmp but it does not. I see we may add image/bmp support in the windows\lib\content-types.properties to make the testcase pass.
>      However I am not sure if OpenJDK do want to support it, or there is some reason why OpenJDK don't?
> 
> 



More information about the net-dev mailing list