org.springframework.web
Class HttpMediaTypeNotSupportedException

java.lang.Object
  extended by ServletException
      extended by org.springframework.web.HttpMediaTypeException
          extended by org.springframework.web.HttpMediaTypeNotSupportedException

public class HttpMediaTypeNotSupportedException
extends HttpMediaTypeException

Exception thrown when a client POSTs or PUTs content not supported by request handler.

Since:
3.0
Author:
Arjen Poutsma

Field Summary
private  MediaType contentType
           
 
Constructor Summary
HttpMediaTypeNotSupportedException(MediaType contentType, java.util.List<MediaType> supportedMediaTypes)
          Create a new HttpMediaTypeNotSupportedException.
HttpMediaTypeNotSupportedException(MediaType contentType, java.util.List<MediaType> supportedMediaTypes, java.lang.String msg)
          Create a new HttpMediaTypeNotSupportedException.
HttpMediaTypeNotSupportedException(java.lang.String message)
          Create a new HttpMediaTypeNotSupportedException.
 
Method Summary
 MediaType getContentType()
          Return the HTTP request content type method that caused the failure.
 
Methods inherited from class org.springframework.web.HttpMediaTypeException
getSupportedMediaTypes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

contentType

private final MediaType contentType
Constructor Detail

HttpMediaTypeNotSupportedException

public HttpMediaTypeNotSupportedException(java.lang.String message)
Create a new HttpMediaTypeNotSupportedException.

Parameters:
message - the exception message

HttpMediaTypeNotSupportedException

public HttpMediaTypeNotSupportedException(MediaType contentType,
                                          java.util.List<MediaType> supportedMediaTypes)
Create a new HttpMediaTypeNotSupportedException.

Parameters:
contentType - the unsupported content type
supportedMediaTypes - the list of supported media types

HttpMediaTypeNotSupportedException

public HttpMediaTypeNotSupportedException(MediaType contentType,
                                          java.util.List<MediaType> supportedMediaTypes,
                                          java.lang.String msg)
Create a new HttpMediaTypeNotSupportedException.

Parameters:
contentType - the unsupported content type
supportedMediaTypes - the list of supported media types
msg - the detail message
Method Detail

getContentType

public MediaType getContentType()
Return the HTTP request content type method that caused the failure.