Class HttpMediaTypeNotSupportedException

  • All Implemented Interfaces:
    java.io.Serializable

    public class HttpMediaTypeNotSupportedException
    extends HttpMediaTypeException

    This class is a clone of org.springframework.web.HttpMediaTypeNotSupportedException

    Exception thrown when a client POSTs, PUTs, or PATCHes content of a type not supported by request handler.
    Author:
    Arjen Poutsma
    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      MediaType getContentType()
      Return the HTTP request content type method that caused the failure.
      • Methods inherited from class javax.servlet.ServletException

        getRootCause
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • HttpMediaTypeNotSupportedException

        public HttpMediaTypeNotSupportedException​(java.lang.String message)
        Create a new HttpMediaTypeNotSupportedException.
        Parameters:
        message - the exception message
      • HttpMediaTypeNotSupportedException

        public HttpMediaTypeNotSupportedException​(@Nullable
                                                  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​(@Nullable
                                                  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

        @Nullable
        public MediaType getContentType()
        Return the HTTP request content type method that caused the failure.
        Returns:
        the media type