DefaultContentTypeResolver

A default {@link ContentTypeResolver} that checks the {@link MessageHeaders#CONTENT_TYPE} header or falls back to a default value.

<p>The header value is expected to be a {@link hunt.framework.util.MimeType} or a {@code string} that can be parsed into a {@code MimeType}.

@author Rossen Stoyanchev @since 4.0

Members

Functions

getDefaultMimeType
MimeType getDefaultMimeType()

Return the default MIME type to use if no {@link MessageHeaders#CONTENT_TYPE} header is present.

resolve
MimeType resolve(MessageHeaders headers)
Undocumented in source. Be warned that the author may not have intended to support it.
setDefaultMimeType
void setDefaultMimeType(MimeType defaultMimeType)

Set the default MIME type to use when there is no {@link MessageHeaders#CONTENT_TYPE} header present. <p>This property does not have a default value.

toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.

Inherited Members

From ContentTypeResolver

resolve
MimeType resolve(MessageHeaders headers)

Determine the {@link MimeType} of a message from the given MessageHeaders. @param headers the headers to use for the resolution @return the resolved {@code MimeType}, or {@code null} if none found @throws InvalidMimeTypeException if the content type is a string that cannot be parsed @throws IllegalArgumentException if there is a content type but its type is unknown

Meta