Package com.google.api.client.http
Class HttpStatusCodes
- java.lang.Object
-
- com.google.api.client.http.HttpStatusCodes
-
public class HttpStatusCodes extends java.lang.ObjectConstants enumerating the HTTP status codes. Includes status codes specified in RFC2616 (HTTP/1.1).- Since:
- 1.6
-
-
Field Summary
Fields Modifier and Type Field Description static intSTATUS_CODE_BAD_GATEWAYStatus code for a bad gateway.static intSTATUS_CODE_CONFLICTStatus code for a request that could not be completed due to a resource conflict.static intSTATUS_CODE_FORBIDDENStatus code for a server that understood the request, but is refusing to fulfill it.static intSTATUS_CODE_FOUNDStatus code for a resource that has temporarily moved to a new URI.static intSTATUS_CODE_MOVED_PERMANENTLYStatus code for a resource that has permanently moved to a new URI.static intSTATUS_CODE_MULTIPLE_CHOICESStatus code for a resource corresponding to any one of a set of representations.static intSTATUS_CODE_NO_CONTENTStatus code for a successful request with no content information.static intSTATUS_CODE_NOT_FOUNDStatus code for a server that has not found anything matching the Request-URI.static intSTATUS_CODE_NOT_MODIFIEDStatus code for a resource that access is allowed but the document has not been modified.static intSTATUS_CODE_OKStatus code for a successful request.static intSTATUS_CODE_SEE_OTHERStatus code for a resource that has moved to a new URI and should be retrieved using GET.static intSTATUS_CODE_SERVER_ERRORStatus code for an internal server error.static intSTATUS_CODE_SERVICE_UNAVAILABLEStatus code for a service that is unavailable on the server.static intSTATUS_CODE_TEMPORARY_REDIRECTStatus code for a resource that has temporarily moved to a new URI.static intSTATUS_CODE_UNAUTHORIZEDStatus code for a request that requires user authentication.
-
Constructor Summary
Constructors Constructor Description HttpStatusCodes()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanisRedirect(int statusCode)Returns whether the given HTTP response status code is a redirect code301, 302, 303, 307.static booleanisSuccess(int statusCode)Returns whether the given HTTP response status code is a success code>= 200 and < 300.
-
-
-
Field Detail
-
STATUS_CODE_OK
public static final int STATUS_CODE_OK
Status code for a successful request.- See Also:
- Constant Field Values
-
STATUS_CODE_NO_CONTENT
public static final int STATUS_CODE_NO_CONTENT
Status code for a successful request with no content information.- Since:
- 1.11
- See Also:
- Constant Field Values
-
STATUS_CODE_MULTIPLE_CHOICES
public static final int STATUS_CODE_MULTIPLE_CHOICES
Status code for a resource corresponding to any one of a set of representations.- See Also:
- Constant Field Values
-
STATUS_CODE_MOVED_PERMANENTLY
public static final int STATUS_CODE_MOVED_PERMANENTLY
Status code for a resource that has permanently moved to a new URI.- See Also:
- Constant Field Values
-
STATUS_CODE_FOUND
public static final int STATUS_CODE_FOUND
Status code for a resource that has temporarily moved to a new URI.- See Also:
- Constant Field Values
-
STATUS_CODE_SEE_OTHER
public static final int STATUS_CODE_SEE_OTHER
Status code for a resource that has moved to a new URI and should be retrieved using GET.- See Also:
- Constant Field Values
-
STATUS_CODE_NOT_MODIFIED
public static final int STATUS_CODE_NOT_MODIFIED
Status code for a resource that access is allowed but the document has not been modified.- See Also:
- Constant Field Values
-
STATUS_CODE_TEMPORARY_REDIRECT
public static final int STATUS_CODE_TEMPORARY_REDIRECT
Status code for a resource that has temporarily moved to a new URI.- See Also:
- Constant Field Values
-
STATUS_CODE_UNAUTHORIZED
public static final int STATUS_CODE_UNAUTHORIZED
Status code for a request that requires user authentication.- See Also:
- Constant Field Values
-
STATUS_CODE_FORBIDDEN
public static final int STATUS_CODE_FORBIDDEN
Status code for a server that understood the request, but is refusing to fulfill it.- See Also:
- Constant Field Values
-
STATUS_CODE_NOT_FOUND
public static final int STATUS_CODE_NOT_FOUND
Status code for a server that has not found anything matching the Request-URI.- See Also:
- Constant Field Values
-
STATUS_CODE_CONFLICT
public static final int STATUS_CODE_CONFLICT
Status code for a request that could not be completed due to a resource conflict.- See Also:
- Constant Field Values
-
STATUS_CODE_SERVER_ERROR
public static final int STATUS_CODE_SERVER_ERROR
Status code for an internal server error.- See Also:
- Constant Field Values
-
STATUS_CODE_BAD_GATEWAY
public static final int STATUS_CODE_BAD_GATEWAY
Status code for a bad gateway.- Since:
- 1.16
- See Also:
- Constant Field Values
-
STATUS_CODE_SERVICE_UNAVAILABLE
public static final int STATUS_CODE_SERVICE_UNAVAILABLE
Status code for a service that is unavailable on the server.- See Also:
- Constant Field Values
-
-
Method Detail
-
isSuccess
public static boolean isSuccess(int statusCode)
Returns whether the given HTTP response status code is a success code>= 200 and < 300.
-
isRedirect
public static boolean isRedirect(int statusCode)
Returns whether the given HTTP response status code is a redirect code301, 302, 303, 307.- Since:
- 1.11
-
-