Package org.htmlunit.util
Class MimeType
java.lang.Object
org.htmlunit.util.MimeType
Utility holding information about association between MIME type and file extensions.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
"application/json".static final String
"application/octet-stream".static final String
application/xhtml+xml.static final String
application/xml.static final String
"image/gif".static final String
"image/jpeg".static final String
"image/png".A map to avoid lowercase conversion and a check check if this is one of our mimetype we know.static final String
"text/css".static final String
"text/html".static final String
"text/javascript".static final String
"text/plain".static final String
"text/xml". -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildMap()
static String
getFileExtension
(String contentType) Gets the preferred file extension for a content type.static boolean
isJavascriptMimeType
(String mimeType) static boolean
isObsoleteJavascriptMimeType
(String mimeType)
-
Field Details
-
TEXT_JAVASCRIPT
"text/javascript".- See Also:
-
APPLICATION_OCTET_STREAM
"application/octet-stream".- See Also:
-
APPLICATION_JSON
"application/json".- See Also:
-
APPLICATION_XHTML
application/xhtml+xml.- See Also:
-
APPLICATION_XML
application/xml.- See Also:
-
TEXT_CSS
"text/css".- See Also:
-
TEXT_HTML
"text/html".- See Also:
-
TEXT_XML
"text/xml".- See Also:
-
TEXT_PLAIN
"text/plain".- See Also:
-
IMAGE_GIF
"image/gif".- See Also:
-
IMAGE_JPEG
"image/jpeg".- See Also:
-
IMAGE_PNG
"image/png".- See Also:
-
type2extension
-
lookupMap
A map to avoid lowercase conversion and a check check if this is one of our mimetype we know. The value is not used.
-
-
Constructor Details
-
MimeType
private MimeType()Disallow instantiation of this class.
-
-
Method Details
-
isJavascriptMimeType
- Parameters:
mimeType
- the type to check- Returns:
- true if the mime type is obsolete
-
isObsoleteJavascriptMimeType
- Parameters:
mimeType
- the type to check- Returns:
- true if the mime type is for js
-
buildMap
-
getFileExtension
Gets the preferred file extension for a content type.- Parameters:
contentType
- the mime type- Returns:
null
if none is known
-