java.lang.Object
org.glassfish.grizzly.http.util.MimeType
Hardcoded mime-type supported by default. Additional extension/mime-type mappings may be added by calling
add(String, String), however, keep in mind that these mappings are per-JVM.- Author:
- Jeanfrancois Arcand
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidAssociates the specified extension and content typestatic booleanstatic Stringstatic Stringstatic StringgetByFilename(String fileName)
-
Constructor Details
-
MimeType
public MimeType()
-
-
Method Details
-
get
- Parameters:
extension- the extension- Returns:
- the content type associated with
extension. If no association is found, this method will returntext/plain
-
get
- 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
- Parameters:
extension- the extension- Returns:
trueif the specified extension has been registered otherwise, returnsfalse
-
add
Associates the specified extension and content type
- Parameters:
extension- the extensioncontentType- the content type associated with the extension
-
getByFilename
- Parameters:
fileName- the filename- Returns:
- the content type associated with
extensionof the given filename or if no associate is found, returnsnull
-