java.net
Class MimeTypeMapper

java.lang.Object
java.net.MimeTypeMapper
- All Implemented Interfaces:
- FileNameMap
- class MimeTypeMapper
- extends java.lang.Object
- implements FileNameMap
This non-public class is used to implement the FileNameMap interface
which defines a mechanism for mapping filenames to MIME types.
- Version:
- 0.5
|
Constructor Summary |
MimeTypeMapper()
Create a new MimeTypeMapper object. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
mime_strings
protected static final java.lang.String[][] mime_strings
- This array of strings is used to identify a MIME type based on a file
extension. This is list is based on the Apache mime.types file.
mime_types
private static java.util.Hashtable mime_types
- The MIME types above are put into this Hashtable for faster lookup.
MimeTypeMapper
public MimeTypeMapper()
- Create a new
MimeTypeMapper object.
getContentTypeFor
public java.lang.String getContentTypeFor(java.lang.String filename)
- The method returns the MIME type of the filename passed as an argument.
The value returned is based on the extension of the filename. The
default content type returned if this method cannot determine the
actual content type is "application/octet-stream"
- Specified by:
getContentTypeFor in interface FileNameMap