Package org.eclipse.jetty.http
Class MimeTypes
java.lang.Object
org.eclipse.jetty.http.MimeTypes
MIME Type enum and utilities
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addMimeMapping
(String extension, String type) Set a mime mappingAccess a mutable map of mime type to the charset assumed for that content type.static String
getCharsetAssumedFromContentType
(String contentType) static String
getCharsetFromContentType
(String value) static String
getCharsetInferredFromContentType
(String contentType) static String
static String
getDefaultMimeByExtension
(String filename) Get the MIME type by filename extension.Access a mutable map of mime type to the charset inferred from that content type.getMimeByExtension
(String filename) Get the MIME type by filename extension.void
setMimeMap
(Map<String, String> mimeMap)
-
Field Details
-
CACHE
-
-
Constructor Details
-
MimeTypes
public MimeTypes()Constructor.
-
-
Method Details
-
getMimeMap
-
setMimeMap
- Parameters:
mimeMap
- A Map of file extension to mime-type.
-
getDefaultMimeByExtension
Get the MIME type by filename extension. Lookup only the static default mime map.- Parameters:
filename
- A file name- Returns:
- MIME type matching the longest dot extension of the file name.
-
getMimeByExtension
Get the MIME type by filename extension. Lookup the content and static default mime maps.- Parameters:
filename
- A file name- Returns:
- MIME type matching the longest dot extension of the file name.
-
addMimeMapping
Set a mime mapping- Parameters:
extension
- the extensiontype
- the mime type
-
getKnownMimeTypes
-
getCharsetFromContentType
-
getInferredEncodings
Access a mutable map of mime type to the charset inferred from that content type. An inferred encoding is used by when encoding/decoding a stream and is explicitly set in any metadata (eg Content-Type).- Returns:
- Map of mime type to charset
-
getAssumedEncodings
Access a mutable map of mime type to the charset assumed for that content type. An assumed encoding is used by when encoding/decoding a stream, but is not explicitly set in any metadata (eg Content-Type).- Returns:
- Map of mime type to charset
-
getCharsetInferredFromContentType
-
getCharsetAssumedFromContentType
-
getContentTypeWithoutCharset
-