public class UnsupportedMediaTypeStatusException extends ResponseStatusException
Modifier and Type | Field and Description |
---|---|
private MediaType |
contentType |
private java.util.List<MediaType> |
supportedMediaTypes |
Constructor and Description |
---|
UnsupportedMediaTypeStatusException(MediaType contentType,
java.util.List<MediaType> supportedMediaTypes)
Constructor for when the Content-Type can be parsed but is not supported.
|
UnsupportedMediaTypeStatusException(java.lang.String reason)
Constructor for when the specified Content-Type is invalid.
|
Modifier and Type | Method and Description |
---|---|
java.util.Optional<MediaType> |
getContentType()
Return the request Content-Type header if it was parsed successfully.
|
java.util.List<MediaType> |
getSupportedMediaTypes()
Return the list of supported content types in cases when the Content-Type
header is parsed but not supported, or an empty list otherwise.
|
getReason, getStatus
contains, getMessage, getMostSpecificCause, getRootCause
private final MediaType contentType
private final java.util.List<MediaType> supportedMediaTypes
public UnsupportedMediaTypeStatusException(java.lang.String reason)
public java.util.Optional<MediaType> getContentType()
public java.util.List<MediaType> getSupportedMediaTypes()