Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7096063

/META-INF/mimetypes.default missing in jre/lib/resources.jar

    Details

    • Subcomponent:
    • Introduced In Build:
      b112
    • Introduced In Version:
      7
    • Resolved In Build:
      b21
    • CPU:
      x86
    • OS:
      windows_xp

      Description

      FULL PRODUCT VERSION :
      java version "1.7.0"
      Java(TM) SE Runtime Environment (build 1.7.0-b147)
      Java HotSpot(TM) Client VM (build 21.0-b17, mixed mode, sharing)

      A DESCRIPTION OF THE PROBLEM :
      The class MimetypesFileTypeMap cannot find the file mimetypes.default. In JDK 6 it was present under /META-INF/mimetypes.default in jre\lib\resources.jar

      The file is missing in JDK 7

      http://download.oracle.com/javase/7/docs/api/javax/activation/MimetypesFileTypeMap.html

      REGRESSION. Last worked in version 6u26

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      System.out.println(new javax.activation.FileDataSource("test.html").getContentType());

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      text/html
      ACTUAL -
      application/octet-stream


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import static org.junit.Assert.*;
      import javax.activation.FileDataSource;
      import org.junit.Test;


      public class ActivationFileDataSourceTest {
      @Test
      public void testHtml() {
      FileDataSource fdsHtml = new FileDataSource("test.html");
      assertEquals("text/html", fdsHtml.getContentType());
      }
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      copy mimetypes.default from JDK 6 and put it somewhere in the classpath under META-INF/

        Attachments

          Activity

            People

            • Assignee:
              ohair Kelly Ohair (Inactive)
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: