|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.northwestern.at.utils.net.mime.MimeTypeMapper
public class MimeTypeMapper
Maps file extensions to mime types.
Field Summary | |
---|---|
protected static java.lang.String[][] |
mimeDefs
Array of mappings between mime types and file extensions. |
Constructor Summary | |
---|---|
MimeTypeMapper()
Null args constructor. |
Method Summary | |
---|---|
java.lang.String |
getContentTypeFor(java.lang.String fileName)
Returns MIME type for a filename. |
static java.lang.String[] |
getMatchingExtensions(java.lang.String mainMimeType)
Returns list of extensions matching main MIME type. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String[][] mimeDefs
The first entry is the mime type, the second is the corresponding extension. Some mime types are associated with more then one extension.
Constructor Detail |
---|
public MimeTypeMapper()
Method Detail |
---|
public java.lang.String getContentTypeFor(java.lang.String fileName)
getContentTypeFor
in interface java.net.FileNameMap
fileName
- Name of file for which mime type is desired.
When the file name's extension is not found in the mime types hash table, a mime type of "application/octet-stream" is returned.
public static java.lang.String[] getMatchingExtensions(java.lang.String mainMimeType)
mainMimeType
- The main mime type, e.g., "audio".
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |