Class MimeTypes.Mutable
java.lang.Object
org.eclipse.jetty.http.MimeTypes
org.eclipse.jetty.http.MimeTypes.Mutable
- Enclosing class:
 MimeTypes
- 
Nested Class Summary
Nested classes/interfaces inherited from class MimeTypes
MimeTypes.Mutable, MimeTypes.Type - 
Field Summary
Fields inherited from class MimeTypes
_assumedEncodings, _assumedNoEncodings, _inferredEncodings, _mimeMap, CACHE, DEFAULTS, ISO_8859_1, UTF16, UTF8 - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionaddAssumed(String mimeType, String encoding) Add an assumed charset encoding for a content-type.voidaddEncodings(Resource encodingProperties) Add the inferred and assumed encodings from a property file in the format of: mimeType=encodingAn inferred encoding for the mimeType mimeType=-encodingAn assumed encoding for the mimeType mimeType=-An assumed no encoding for the mimeType The mimeType may be a wildcard like "image/*"addInferred(String mimeType, String encoding) Add an inferred encoding for a mimeTypeaddMimeMapping(String extension, String type) Set a mime mappingvoidaddMimeTypes(Resource mimeProperties) Add the mime types from a properties file in the format "ext=mimeType" (e.g.voidclear()Clear the MimeTypes references.booleanvoidMerge theMimeTypesmappings and encodings from anotherMimeTypes.voidsetEncodings(Resource encodingProperties) Set the inferred and assumed encodings from a property file in the format of: mimeType=encodingAn inferred encoding for the mimeType mimeType=-encodingAn assumed encoding for the mimeType mimeType=-An assumed no encoding for the mimeType The mimeType may be a wildcard like "image/*"voidSet theMimeTypesmappings and encodings from anotherMimeTypesvoidsetMimeTypes(Resource mimeProperties) Set the mime types from a properties file in the format "ext=mimeType" (e.g.Methods inherited from class MimeTypes
getAssumedCharset, getAssumedCharsetName, getBase, getBaseType, getCharset, getCharset, getCharsetFromContentType, getCharsetFromContentType, getContentTypeWithoutCharset, getInferredCharset, getInferredCharsetName, getKnownCharset, getMimeByExtension, getMimeForExtension, getMimeMap, getMimeTypeAsStringFromContentType, getMimeTypeFromContentType, isCharsetAssumed, isKnownLocale, loadEncodings, loadMimeProperties, normalizeCharset, normalizeCharset 
- 
Constructor Details
- 
Mutable
public Mutable() - 
Mutable
 
 - 
 - 
Method Details
- 
isDefault
public boolean isDefault() - 
clear
public void clear()Clear the MimeTypes references.
Once you have cleared out the MimeTypes object, make sure to properly set it up with extension to mime-type maps, along with inferred and assumed charsets for the relevant mime-types (eg: html, text, json, etc).
- See Also:
 
 - 
addMimeMapping
 - 
addInferred
 - 
addAssumed
Add an assumed charset encoding for a content-type. Default values for this mapping are set by the "encoding.properties" class path resource.- Parameters:
 mimeType- The mimeType to map to an encoding, either in absolute form (e.g. "text/html") or wildcard form (e.g. "image/*").encoding- The assumed encoding; or the empty string if it is assumed to have no charset; ornullif there is no assumed charset.- Returns:
 - The old value.
 
 - 
setMimeTypes
Set the mime types from a properties file in the format "ext=mimeType" (e.g. "txt=text/plain")- Parameters:
 mimeProperties- The property file to use.- Throws:
 UncheckedIOException- if there is anIOException- See Also:
 
 - 
addMimeTypes
Add the mime types from a properties file in the format "ext=mimeType" (e.g. "txt=text/plain")- Parameters:
 mimeProperties- The property file to use.- Throws:
 UncheckedIOException- if there is anIOException- See Also:
 
 - 
setEncodings
Set the inferred and assumed encodings from a property file in the format of:- mimeType=encoding
 - An inferred encoding for the mimeType
 - mimeType=-encoding
 - An assumed encoding for the mimeType
 - mimeType=-
 - An assumed no encoding for the mimeType
 
- Parameters:
 encodingProperties- The property file to use.- Throws:
 UncheckedIOException- if there is anIOException- See Also:
 
 - 
addEncodings
Add the inferred and assumed encodings from a property file in the format of:- mimeType=encoding
 - An inferred encoding for the mimeType
 - mimeType=-encoding
 - An assumed encoding for the mimeType
 - mimeType=-
 - An assumed no encoding for the mimeType
 
- Parameters:
 encodingProperties- The property file to use.- Throws:
 UncheckedIOException- if there is anIOException- See Also:
 
 - 
setFrom
Set theMimeTypesmappings and encodings from anotherMimeTypes- Parameters:
 other- The otherMimeTypes.
 - 
mergeFrom
Merge theMimeTypesmappings and encodings from anotherMimeTypes. Any non default values in this instance are kept in preference to the values from the other.- Parameters:
 other- The otherMimeTypes.
 
 -