Class HttpSC

java.lang.Object
org.apache.jena.web.HttpSC

public class HttpSC extends Object

HttpStatusCode enum class, for status codes based on various HTTP RFCs. (see table below)

Enum Code Message RFC 1945 - HTTP/1.0 RFC 2616 - HTTP/1.1 RFC 2518 - WEBDAV
Informational - 1xx isInformational(int)
CONTINUE_100 100 Continue   Sec. 10.1.1  
SWITCHING_PROTOCOLS_101 101 Switching Protocols   Sec. 10.1.2  
PROCESSING_102 102 Processing     Sec. 10.1
Success - 2xx isSuccess(int)
OK_200 200 OK Sec. 9.2 Sec. 10.2.1  
CREATED_201 201 Created Sec. 9.2 Sec. 10.2.2  
ACCEPTED_202 202 Accepted Sec. 9.2 Sec. 10.2.3  
NON_AUTHORITATIVE_INFORMATION_203 203 Non Authoritative Information   Sec. 10.2.4  
NO_CONTENT_204 204 No Content Sec. 9.2 Sec. 10.2.5  
RESET_CONTENT_205 205 Reset Content   Sec. 10.2.6  
PARTIAL_CONTENT_206 206 Partial Content   Sec. 10.2.7  
MULTI_STATUS_207 207 Multi-Status     Sec. 10.2
  207 Partial Update OK   draft/01  
Redirection - 3xx isRedirection(int)
MULTIPLE_CHOICES_300 300 Multipldirecte Choices Sec. 9.3 Sec. 10.3.1  
MOVED_PERMANENTLY_301 301 Moved Permanently Sec. 9.3 Sec. 10.3.2  
MOVED_TEMPORARILY_302 302 Moved Temporarily Sec. 9.3 (now "302 Found")  
FOUND_302 302 Found (was "302 Moved Temporarily") Sec. 10.3.3  
SEE_OTHER_303 303 See Other   Sec. 10.3.4  
NOT_MODIFIED_304 304 Not Modified Sec. 9.3 Sec. 10.3.5  
USE_PROXY_305 305 Use Proxy   Sec. 10.3.6  
  306 (Unused)   Sec. 10.3.7  
TEMPORARY_REDIRECT_307 307 Temporary Redirect   Sec. 10.3.8  
Client Error - 4xx isClientError(int)
BAD_REQUEST_400 400 Bad Request Sec. 9.4 Sec. 10.4.1  
UNAUTHORIZED_401 401 Unauthorized Sec. 9.4 Sec. 10.4.2  
PAYMENT_REQUIRED_402 402 Payment Required Sec. 9.4 direct Sec. 10.4.3  
FORBIDDEN_403 403 Forbidden Sec. 9.4 Sec. 10.4.4  
NOT_FOUND_404 404 Not Found Sec. 9.4 Sec. 10.4.5  
METHOD_NOT_ALLOWED_405 405 Method Not Allowed   Sec. 10.4.6  
NOT_ACCEPTABLE_406 406 Not Acceptable   Sec. 10.4.7  
PROXY_AUTHENTICATION_REQUIRED_407 407 Proxy Authentication Required   Sec. 10.4.8  
REQUEST_TIMEOUT_408 408 Request Timeout   Sec. 10.4.9  
CONFLICT_409 409 Conflict   Sec. 10.4.10  
GONE_410 410 Gone   Sec. 10.4.11  
LENGTH_REQUIRED_411 411 Length Required   Sec. 10.4.12  
PRECONDITION_FAILED_412 412 Precondition Failed   Sec. 10.4.13  
REQUEST_ENTITY_TOO_LARGE_413 413 Request Entity Too Large   Sec. 10.4.14  
REQUEST_URI_TOO_LONG_414 414 Request-URI Too Long   Sec. 10.4.15  
UNSUPPORTED_MEDIA_TYPE_415 415 Unsupported Media Type   Sec. 10.4.16  
REQUESTED_RANGE_NOT_SATISFIABLE_416 416 Requested Range Not Satisfiable   Sec. 10.4.17  
EXPECTATION_FAILED_417 417 Expectation Failed   Sec. 10.4.18  
  418 Reauthentication Required   draft/01  
  418 Unprocessable Entity     draft/05
  419 Proxy Reauthentication Required   draft/01  
  419 Insufficient Space on Resource     draft/05
  420 Method Failure     draft/05
  421 (Unused)      
UNPROCESSABLE_ENTITY_422 422 Unprocessable Entity     Sec. 10.3
LOCKED_423 423 Locked     Sec. 10.4
FAILED_DEPENDENCY_424 424 Failed Dependency     Sec. 10.5
Server Error - 5xx isServerError(int)
INTERNAL_SERVER_ERROR_500 500 Internal Server Error Sec. 9.5 Sec. 10.5.1  
NOT_IMPLEMENTED_501 501 Not Implemented Sec. 9.5 Sec. 10.5.2  
BAD_GATEWAY_502 502 Bad Gateway Sec. 9.5 Sec. 10.5.3  
SERVICE_UNAVAILABLE_503 503 Service Unavailable Sec. 9.5 Sec. 10.5.4  
GATEWAY_TIMEOUT_504 504 Gateway Timeout   Sec. 10.5.5  
HTTP_VERSION_NOT_SUPPORTED_505 505 HTTP Version Not Supported   Sec. 10.5.6  
  506 (Unused)      
INSUFFICIENT_STORAGE_507 507 Insufficient Storage     Sec. 10.6
  • Field Details

  • Constructor Details

    • HttpSC

      public HttpSC()
  • Method Details

    • getCode

      public static HttpSC.Code getCode(int code)
      Get the HttpStatusCode for a specific code
      Parameters:
      code - the code to lookup.
      Returns:
      the HttpSC if found, or null if not found.
    • getMessage

      public static String getMessage(int code)
      Get the status message for a specific code.
      Parameters:
      code - the code to look up
      Returns:
      the specific message, or the code number itself if code does not match known list.
    • isInformational

      public static boolean isInformational(int code)
      Simple test against an code to determine if it falls into the Informational message category as defined in the RFC 1945 - HTTP/1.0, and RFC 2616 - HTTP/1.1.
      Parameters:
      code - the code to test.
      Returns:
      true if within range of codes that belongs to Informational messages.
    • isSuccess

      public static boolean isSuccess(int code)
      Simple test against an code to determine if it falls into the Success message category as defined in the RFC 1945 - HTTP/1.0, and RFC 2616 - HTTP/1.1.
      Parameters:
      code - the code to test.
      Returns:
      true if within range of codes that belongs to Success messages.
    • isRedirection

      public static boolean isRedirection(int code)
      Simple test against an code to determine if it falls into the Redirection message category as defined in the RFC 1945 - HTTP/1.0, and RFC 2616 - HTTP/1.1.
      Parameters:
      code - the code to test.
      Returns:
      true if within range of codes that belongs to Redirection messages.
    • isError

      public static boolean isError(int code)
    • isClientError

      public static boolean isClientError(int code)
      Simple test against an code to determine if it falls into the Client Error message category as defined in the RFC 1945 - HTTP/1.0, and RFC 2616 - HTTP/1.1.
      Parameters:
      code - the code to test.
      Returns:
      true if within range of codes that belongs to Client Error messages.
    • isServerError

      public static boolean isServerError(int code)
      Simple test against an code to determine if it falls into the Server Error message category as defined in the RFC 1945 - HTTP/1.0, and RFC 2616 - HTTP/1.1.
      Parameters:
      code - the code to test.
      Returns:
      true if within range of codes that belongs to Server Error messages.