|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.activation.FileTypeMap
javax.activation.MimetypesFileTypeMap
Implementation of FileTypeMap that uses the mime.types format. File entries are searched for in the following locations and order:
Constructor Summary | |
MimetypesFileTypeMap()
Default constructor. |
|
MimetypesFileTypeMap(java.io.InputStream is)
Constructor specifying an input stream. |
|
MimetypesFileTypeMap(java.lang.String mimeTypeFileName)
Constructor specifying a filename. |
Method Summary | |
void |
addMimeTypes(java.lang.String mime_types)
Adds entries prorammatically to the registry. |
java.lang.String |
getContentType(java.io.File f)
Returns the MIME content type of the file. |
java.lang.String |
getContentType(java.lang.String filename)
Returns the MIME type based on the given filename. |
Methods inherited from class javax.activation.FileTypeMap |
getDefaultFileTypeMap, setDefaultFileTypeMap |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MimetypesFileTypeMap()
public MimetypesFileTypeMap(java.lang.String mimeTypeFileName) throws java.io.IOException
mimeTypeFileName
- the name of the file to read mime.types
entries frompublic MimetypesFileTypeMap(java.io.InputStream is)
is
- the input stream to read mime.types entries fromMethod Detail |
public void addMimeTypes(java.lang.String mime_types)
mime_types
- a mime.types formatted entries stringpublic java.lang.String getContentType(java.io.File f)
getContentType(f.getName())
.
getContentType
in class FileTypeMap
f
- the filepublic java.lang.String getContentType(java.lang.String filename)
getContentType
in class FileTypeMap
filename
- the filename
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |