public class DefaultContentTypeResolver extends Object implements ContentTypeResolver
ContentTypeResolver
that checks the
MessageHeaders.CONTENT_TYPE
header or falls back to a default value.
The header value is expected to be a MimeType
or a String
that can be parsed into a MimeType
.
Constructor and Description |
---|
DefaultContentTypeResolver() |
Modifier and Type | Method and Description |
---|---|
MimeType |
getDefaultMimeType()
Return the default MIME type to use if no
MessageHeaders.CONTENT_TYPE header is present. |
MimeType |
resolve(MessageHeaders headers)
Determine the
MimeType of a message from the given MessageHeaders. |
void |
setDefaultMimeType(MimeType defaultMimeType)
Set the default MIME type to use when there is no
MessageHeaders.CONTENT_TYPE header present. |
String |
toString() |
public void setDefaultMimeType(MimeType defaultMimeType)
MessageHeaders.CONTENT_TYPE
header present.
This property does not have a default value.
public MimeType getDefaultMimeType()
MessageHeaders.CONTENT_TYPE
header is present.public MimeType resolve(MessageHeaders headers)
ContentTypeResolver
MimeType
of a message from the given MessageHeaders.resolve
in interface ContentTypeResolver
headers
- the headers to use for the resolutionMimeType
of null
if none found