Package de.uplanet.net.http
Class HttpMethodNotAllowedException
java.lang.Object
java.lang.Throwable
java.lang.Exception
de.uplanet.net.http.HttpErrorException
de.uplanet.net.http.HttpClientErrorException
de.uplanet.net.http.HttpMethodNotAllowedException
- All Implemented Interfaces:
Serializable
@ResponseStatus(METHOD_NOT_ALLOWED)
public final class HttpMethodNotAllowedException
extends HttpClientErrorException
This exception corresponds to the HTTP 405 status code.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionHttpMethodNotAllowedException(HTTP_METHOD... p_allowedMethods) Create a HTTP exception with the status code405 Method Not Allowed.HttpMethodNotAllowedException(Throwable p_cause, HTTP_METHOD... p_allowedMethods) Create a HTTP exception with the status code405 Method Not Allowed.HttpMethodNotAllowedException(Throwable p_cause, EnumSet<HTTP_METHOD> p_allowedMethods) Create a HTTP exception with the status code405 Method Not Allowed.HttpMethodNotAllowedException(EnumSet<HTTP_METHOD> p_allowedMethods) Create a HTTP exception with the status code405 Method Not Allowed. -
Method Summary
Modifier and TypeMethodDescriptionGet a copy of an enum set that contains all allowed methods.Get the allowed methods formatted as a list suitable to be used as a value of the HTTPAllowheader.intGet the HTTP status associated with this error.booleanCheck if allowed methods are specified.Methods inherited from class de.uplanet.net.http.HttpErrorException
getStatusMessageMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
HttpMethodNotAllowedException
Create a HTTP exception with the status code405 Method Not Allowed.An optional list of allowed methods can be specified which can be used to set the HTTP
Allowheader in responses.- Parameters:
p_allowedMethods- An optional list of allowed methods.
-
HttpMethodNotAllowedException
Create a HTTP exception with the status code405 Method Not Allowed.An optional list of allowed methods can be specified which can be used to set the HTTP
Allowheader in responses.- Parameters:
p_allowedMethods- An optional list of allowed methods.
-
HttpMethodNotAllowedException
Create a HTTP exception with the status code405 Method Not Allowed.An optional list of allowed methods can be specified which can be used to set the HTTP
Allowheader in responses.- Parameters:
p_cause- The cause that can be later retrieved by theThrowable.getCause()method.p_allowedMethods- An optional list of allowed methods.
-
HttpMethodNotAllowedException
Create a HTTP exception with the status code405 Method Not Allowed.An optional list of allowed methods can be specified which can be used to set the HTTP
Allowheader in responses.- Parameters:
p_cause- The cause that can be later retrieved by theThrowable.getCause()method.p_allowedMethods- An optional list of allowed methods.
-
-
Method Details
-
getStatus
public int getStatus()Description copied from class:HttpErrorExceptionGet the HTTP status associated with this error.- Overrides:
getStatusin classHttpErrorException- Returns:
- The HTTP status code
405 Method Not Allowed.
-
hasAllowedMethods
public boolean hasAllowedMethods()Check if allowed methods are specified.- Returns:
trueif allowed methods are specified, orfalseotherwise.
-
getAllowedMethods
Get a copy of an enum set that contains all allowed methods.- Returns:
- The enum set.
-
getAllowedMethodsHeaderValue
Get the allowed methods formatted as a list suitable to be used as a value of the HTTPAllowheader.- Returns:
- The allowed methods, or
nullifhasAllowedMethods()isfalse.
-