|
Préférences
Moteurs de recherche
|
||||||||||||||||||
JavaTM Platform, Enterprise Edition, v 5.0
javax.activation
|
Constructor Summary | |
---|---|
MimetypesFileTypeMap()
The default constructor. |
|
MimetypesFileTypeMap(InputStream is)
Construct a MimetypesFileTypeMap with programmatic entries added from the InputStream. |
|
MimetypesFileTypeMap(String mimeTypeFileName)
Construct a MimetypesFileTypeMap with programmatic entries added from the named file. |
Method Summary | |
---|---|
void |
addMimeTypes(String mime_types)
Prepend the MIME type values to the registry. |
String |
getContentType(File f)
Return the MIME type of the file object. |
String |
getContentType(String filename)
Return the MIME type based on the specified file name. |
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 file name
IOException
public MimetypesFileTypeMap(InputStream is)
is
- the input stream to read fromMethod Detail |
---|
public void addMimeTypes(String mime_types)
mime_types
- A .mime.types formatted string of entries.public String getContentType(File f)
getContentType(f.getName())
.
getContentType
in class FileTypeMap
f
- the file
public String getContentType(String filename)
getContentType
in class FileTypeMap
filename
- the file name