Package org.glassfish.grizzly.http.util
Class MimeType
- java.lang.Object
-
- org.glassfish.grizzly.http.util.MimeType
-
public class MimeType extends Object
Hardcoded mime-type supported by default. Additional extension/mime-type mappings may be added by callingadd(String, String), however, keep in mind that these mappings are per-JVM.- Author:
- Jeanfrancois Arcand
-
-
Constructor Summary
Constructors Constructor Description MimeType()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidadd(String extension, String contentType)Associates the specified extension and content typestatic booleancontains(String extension)static Stringget(String extension)static Stringget(String extension, String defaultCt)static StringgetByFilename(String fileName)
-
-
-
Method Detail
-
get
public static String get(String extension)
- Parameters:
extension- the extension- Returns:
- the content type associated with
extension. If no association is found, this method will returntext/plain
-
get
public static String get(String extension, String defaultCt)
- Parameters:
extension- the extensiondefaultCt- the content type to return if there is no known association for the specified extension- Returns:
- the content type associated with
extensionor if no associate is found, returnsdefaultCt
-
contains
public static boolean contains(String extension)
- Parameters:
extension- the extension- Returns:
trueif the specified extension has been registered otherwise, returnsfalse
-
add
public static void add(String extension, String contentType)
Associates the specified extension and content type
- Parameters:
extension- the extensioncontentType- the content type associated with the extension
-
-