public class MimetypesFileTypeMap extends FileTypeMap
Constructor and Description |
---|
MimetypesFileTypeMap()
Default constructor.
|
MimetypesFileTypeMap(InputStream is)
Constructor specifying an input stream.
|
MimetypesFileTypeMap(String mimeTypeFileName)
Constructor specifying a filename.
|
Modifier and Type | Method and Description |
---|---|
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.
|
getDefaultFileTypeMap, setDefaultFileTypeMap
public MimetypesFileTypeMap()
public MimetypesFileTypeMap(String mimeTypeFileName) throws IOException
mimeTypeFileName
- the name of the file to read mime.types
entries fromIOException
public MimetypesFileTypeMap(InputStream is)
is
- the input stream to read mime.types entries frompublic void addMimeTypes(String mime_types)
mime_types
- a mime.types formatted entries stringpublic String getContentType(File f)
getContentType(f.getName())
.getContentType
in class FileTypeMap
f
- the filepublic String getContentType(String filename)
getContentType
in class FileTypeMap
filename
- the filename