Class MimeTypes.Mutable
java.lang.Object
org.eclipse.jetty.http.MimeTypes
org.eclipse.jetty.http.MimeTypes.Mutable
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jetty.http.MimeTypes
MimeTypes.Mutable, MimeTypes.Type
-
Field Summary
Fields inherited from class org.eclipse.jetty.http.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.void
addEncodings
(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 mappingvoid
addMimeTypes
(Resource mimeProperties) Add the mime types from a properties file in the format "ext=mimeType" (e.g.boolean
void
Merge theMimeTypes
mappings and encodings from anotherMimeTypes
.void
setEncodings
(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/*"void
Set theMimeTypes
mappings and encodings from anotherMimeTypes
void
setMimeTypes
(Resource mimeProperties) Set the mime types from a properties file in the format "ext=mimeType" (e.g.Methods inherited from class org.eclipse.jetty.http.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() -
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; ornull
if 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 theMimeTypes
mappings and encodings from anotherMimeTypes
- Parameters:
other
- The otherMimeTypes
.
-
mergeFrom
Merge theMimeTypes
mappings 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
.
-