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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user