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 void
Associates the specified extension and content typestatic boolean
static String
static String
static String
getByFilename
(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
extension
or if no associate is found, returnsdefaultCt
-
contains
- Parameters:
extension
- the extension- Returns:
true
if 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
extension
of the given filename or if no associate is found, returnsnull
-