public final class HttpStatus
extends java.lang.Object
HttpStatus for a specific status code call fromStatusCode(int).| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
static HttpStatus |
fromStatusCode(int statusCode)
Returns the
HttpStatus having the given status code. |
static HttpStatus |
fromStatusLine(java.lang.String statusLine)
Parse an HTTP status line for the status code.
|
int |
hashCode() |
boolean |
isClientError()
Returns whether this status represents a client error status code.
|
boolean |
isInformational()
Returns whether this represents an informational status code.
|
boolean |
isRedirect()
Returns whether this status represents a redirection status code.
|
boolean |
isServerError()
Returns whether this status represents a server error status code.
|
boolean |
isSuccess()
Returns whether this status represents a success status code.
|
java.lang.String |
reason()
Returns the reason phrase of this status code.
|
int |
statusCode()
Returns the status code.
|
java.lang.String |
statusLine(int httpVersionMajor,
int httpVersionMinor)
Returns a status line in the form:
HTTP/VersionMajor.VersionMinor SP Status-Code SP Reason-Phrase
|
public static final HttpStatus CONTINUE
public static final HttpStatus SWITCHING_PROTOCOLS
public static final HttpStatus PROCESSING
Note that this has been removed from the WebDAV specification in RFC 4918, see RFC 4918, section 21.4
public static final HttpStatus OK
public static final HttpStatus CREATED
public static final HttpStatus ACCEPTED
public static final HttpStatus NON_AUTHORITATIVE_INFORMATION
public static final HttpStatus NO_CONTENT
public static final HttpStatus RESET_CONTENT
public static final HttpStatus PARTIAL_CONTENT
public static final HttpStatus MULTISTATUS
public static final HttpStatus MULTIPLE_CHOICES
public static final HttpStatus MOVED_PERMANENTLY
public static final HttpStatus FOUND
public static final HttpStatus SEE_OTHER
public static final HttpStatus NOT_MODIFIED
public static final HttpStatus USE_PROXY
public static final HttpStatus TEMPORARY_REDIRECT
public static final HttpStatus PERMANENT_REDIRECT
public static final HttpStatus BAD_REQUEST
public static final HttpStatus UNAUTHORIZED
public static final HttpStatus PAYMENT_REQUIRED
public static final HttpStatus FORBIDDEN
public static final HttpStatus NOT_FOUND
public static final HttpStatus METHOD_NOT_ALLOWED
public static final HttpStatus NOT_ACCEPTABLE
public static final HttpStatus PROXY_AUTHENTICATION_REQUIRED
public static final HttpStatus REQUEST_TIMEOUT
public static final HttpStatus CONFLICT
public static final HttpStatus GONE
public static final HttpStatus LENGTH_REQUIRED
public static final HttpStatus PRECONDITION_FAILED
public static final HttpStatus PAYLOAD_TOO_LARGE
@Deprecated public static final HttpStatus REQUEST_ENTITY_TOO_LARGE
PAYLOAD_TOO_LARGE.public static final HttpStatus URI_TOO_LONG
@Deprecated public static final HttpStatus REQUEST_URI_TOO_LONG
URI_TOO_LONG.public static final HttpStatus UNSUPPORTED_MEDIA_TYPE
public static final HttpStatus EXPECTATION_FAILED
public static final HttpStatus UNPROCESSABLE_ENTITY
public static final HttpStatus LOCKED
public static final HttpStatus FAILED_DEPENDENCY
public static final HttpStatus UPGRADE_REQUIRED
public static final HttpStatus INTERNAL_SERVER_ERROR
public static final HttpStatus NOT_IMPLEMENTED
public static final HttpStatus BAD_GATEWAY
public static final HttpStatus SERVICE_UNAVAILABLE
public static final HttpStatus GATEWAY_TIMEOUT
public static final HttpStatus HTTP_VERSION_NOT_SUPPORTED
public static final HttpStatus VARIANT_ALSO_NEGOTIATES
public static final HttpStatus INSUFFICIENT_STORAGE
public static HttpStatus fromStatusLine(java.lang.String statusLine) throws java.lang.IllegalArgumentException
statusLine - A String containing an HTTP status line.HttpStatus object.java.lang.IllegalArgumentException - if the given status line doesn't contain a known status code or the status code is invalid.public static HttpStatus fromStatusCode(int statusCode)
HttpStatus having the given status code.statusCode - An HTTP status code integer.HttpStatus having the given status code.public int statusCode()
public java.lang.String reason()
Note: the reason phrase doesn't contain the status code itself.
null if the status code is unknown.public java.lang.String statusLine(int httpVersionMajor,
int httpVersionMinor)
HTTP/VersionMajor.VersionMinor SP Status-Code SP Reason-Phrase
httpVersionMajor - The major version number, usually 1httpVersionMinor - The minor version number, usually 1public boolean isInformational()
true if this represents an informational status code, false otherwise.public boolean isSuccess()
true if this represents a success status code, false otherwise.public boolean isRedirect()
true if this represents a redirection status code, false otherwise.public boolean isClientError()
true if this represents a client error status code, false otherwise.public boolean isServerError()
true if this represents a server error status code, false otherwise.public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object