public class MimeType extends Object
| 构造器和说明 |
|---|
MimeType() |
| 限定符和类型 | 方法和说明 |
|---|---|
static boolean |
contains(String extension) |
static String |
get(String extension) |
static String |
get(String extension,
String defaultCt) |
static String |
getByFilename(String fileName) |
static String |
getByFilename(String fileName,
String defaultType) |
static void |
put(String extension,
String contentType)
Associates the specified extension and content type
|
public static String get(String extension)
extension - the extensionextension. If no association is found, this method will
return text/plainpublic static String get(String extension, String defaultCt)
extension - the extensiondefaultCt - the content type to return if there is no known association for the specified extensionextension or if no associate is found, returns
defaultCtpublic static boolean contains(String extension)
extension - the extensiontrue if the specified extension has been registered otherwise, returns falsepublic static void put(String extension, String contentType)
Associates the specified extension and content type
extension - the extensioncontentType - the content type associated with the extensionpublic static String getByFilename(String fileName)
fileName - the filenameextension of the
given filename or if no associate is found, returns
nullCopyright © 2014–2016. All rights reserved.