Interface ContentTypeResolver
- All Known Implementing Classes:
DefaultContentTypeResolver
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Resolve the content type for a message.
- Since:
- 4.0
- Author:
- Rossen Stoyanchev
-
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.util.MimeType
resolve
(MessageHeaders headers) Determine theMimeType
of a message from the given MessageHeaders.
-
Method Details
-
resolve
@Nullable org.springframework.util.MimeType resolve(@Nullable MessageHeaders headers) throws org.springframework.util.InvalidMimeTypeException Determine theMimeType
of a message from the given MessageHeaders.- Parameters:
headers
- the headers to use for the resolution- Returns:
- the resolved
MimeType
, ornull
if none found - Throws:
org.springframework.util.InvalidMimeTypeException
- if the content type is a String that cannot be parsedIllegalArgumentException
- if there is a content type but its type is unknown
-