-
Bug
-
Resolution: Fixed
-
P4
-
7
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/
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/