|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.activation.FileTypeMap
javax.activation.MimetypesFileTypeMap
public class 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(InputStream is)
Constructor specifying an input stream. |
|
MimetypesFileTypeMap(String mimeTypeFileName)
Constructor specifying a filename. |
|
| Method Summary | |
|---|---|
void |
addMimeTypes(String mime_types)
Adds entries prorammatically to the registry. |
String |
getContentType(File f)
Returns the MIME content type of the file. |
String |
getContentType(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(String mimeTypeFileName)
throws IOException
mimeTypeFileName - the name of the file to read mime.types
entries from
IOExceptionpublic MimetypesFileTypeMap(InputStream is)
is - the input stream to read mime.types entries from| Method Detail |
|---|
public void addMimeTypes(String mime_types)
mime_types - a mime.types formatted entries stringpublic String getContentType(File f)
getContentType(f.getName()).
getContentType in class FileTypeMapf - the filepublic String getContentType(String filename)
getContentType in class FileTypeMapfilename - the filename
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||