Klasse HttpMethodNotAllowedException

Alle implementierten Schnittstellen:
Serializable

@ResponseStatus(METHOD_NOT_ALLOWED) public final class HttpMethodNotAllowedException extends HttpClientErrorException
This exception corresponds to the HTTP 405 status code.
Siehe auch:
  • Konstruktordetails

    • HttpMethodNotAllowedException

      public HttpMethodNotAllowedException(HTTP_METHOD... p_allowedMethods)
      Create a HTTP exception with the status code 405 Method Not Allowed.

      An optional list of allowed methods can be specified which can be used to set the HTTP Allow header in responses.

      Parameter:
      p_allowedMethods - An optional list of allowed methods.
    • HttpMethodNotAllowedException

      public HttpMethodNotAllowedException(EnumSet<HTTP_METHOD> p_allowedMethods)
      Create a HTTP exception with the status code 405 Method Not Allowed.

      An optional list of allowed methods can be specified which can be used to set the HTTP Allow header in responses.

      Parameter:
      p_allowedMethods - An optional list of allowed methods.
    • HttpMethodNotAllowedException

      public HttpMethodNotAllowedException(Throwable p_cause, HTTP_METHOD... p_allowedMethods)
      Create a HTTP exception with the status code 405 Method Not Allowed.

      An optional list of allowed methods can be specified which can be used to set the HTTP Allow header in responses.

      Parameter:
      p_cause - The cause that can be later retrieved by the Throwable.getCause() method.
      p_allowedMethods - An optional list of allowed methods.
    • HttpMethodNotAllowedException

      public HttpMethodNotAllowedException(Throwable p_cause, EnumSet<HTTP_METHOD> p_allowedMethods)
      Create a HTTP exception with the status code 405 Method Not Allowed.

      An optional list of allowed methods can be specified which can be used to set the HTTP Allow header in responses.

      Parameter:
      p_cause - The cause that can be later retrieved by the Throwable.getCause() method.
      p_allowedMethods - An optional list of allowed methods.
  • Methodendetails

    • getStatus

      public int getStatus()
      Beschreibung aus Klasse kopiert: HttpErrorException
      Get the HTTP status associated with this error.
      Setzt außer Kraft:
      getStatus in Klasse HttpErrorException
      Gibt zurück:
      The HTTP status code 405 Method Not Allowed.
    • hasAllowedMethods

      public boolean hasAllowedMethods()
      Check if allowed methods are specified.
      Gibt zurück:
      true if allowed methods are specified, or false otherwise.
    • getAllowedMethods

      public EnumSet<HTTP_METHOD> getAllowedMethods()
      Get a copy of an enum set that contains all allowed methods.
      Gibt zurück:
      The enum set.
    • getAllowedMethodsHeaderValue

      public String getAllowedMethodsHeaderValue()
      Get the allowed methods formatted as a list suitable to be used as a value of the HTTP Allow header.
      Gibt zurück:
      The allowed methods, or null if hasAllowedMethods() is false.