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
This exception corresponds to the HTTP 405 status code.
- See Also:
-
Constructor Summary
ConstructorDescriptionHttpMethodNotAllowedException
(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 HTTPAllow
header.int
Get the HTTP status associated with this error.boolean
Check if allowed methods are specified.Methods inherited from class de.uplanet.net.http.HttpErrorException
getStatusMessage
Methods 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
Allow
header 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
Allow
header 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
Allow
header 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
Allow
header 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:HttpErrorException
Get the HTTP status associated with this error.- Overrides:
getStatus
in classHttpErrorException
- Returns:
- The HTTP status code
405 Method Not Allowed
.
-
hasAllowedMethods
public boolean hasAllowedMethods()Check if allowed methods are specified.- Returns:
true
if allowed methods are specified, orfalse
otherwise.
-
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 HTTPAllow
header.- Returns:
- The allowed methods, or
null
ifhasAllowedMethods()
isfalse
.
-