class MimeTypes extends Object
Supports mime types only, not encodings. Does not support a default "*" mapping.
This is only for local mappings. Caller should use getServletContext().getMimeType() if this returns null.
------------------------------------------------------------
| Constructor and Description |
|---|
MimeTypes() |
| Modifier and Type | Method and Description |
|---|---|
void |
addMimeMapping(String extension,
String type)
Set a mime mapping
|
String |
getMimeByExtension(String filename)
Get the MIME type by filename extension.
|
void |
loadMimeMap(String resourcePath) |
public void addMimeMapping(String extension, String type)
extension - type - public String getMimeByExtension(String filename)
Returns ONLY local mappings. Caller should use getServletContext().getMimeType() if this returns null.
filename - A file namepublic void loadMimeMap(String resourcePath)
resourcePath - A Map of file extension to mime-type.