Remove MimeTypeResolver since JAF is part of Java SE 6+

The inner MimeTypeResolver class is no longer necessary in the
MockServletContext since the Java Activation Framework (JAF) is a
standard part of Java SE since Java 6.
This commit is contained in:
Sam Brannen
2015-10-06 15:56:00 +02:00
parent da99897676
commit 3db62d5494
2 changed files with 3 additions and 27 deletions

View File

@@ -291,7 +291,7 @@ public class MockServletContext implements ServletContext {
*/
@Override
public String getMimeType(String filePath) {
String mimeType = MimeTypeResolver.getMimeType(filePath);
String mimeType = FileTypeMap.getDefaultFileTypeMap().getContentType(filePath);
return ("application/octet-stream".equals(mimeType) ? null : mimeType);
}
@@ -680,16 +680,4 @@ public class MockServletContext implements ServletContext {
throw new UnsupportedOperationException();
}
/**
* Inner factory class used to introduce a Java Activation Framework
* dependency when actually asked to resolve a MIME type.
*/
private static class MimeTypeResolver {
public static String getMimeType(String filePath) {
return FileTypeMap.getDefaultFileTypeMap().getContentType(filePath);
}
}
}