Package org.basex.http
Enum HTTPStatus
- java.lang.Object
-
- java.lang.Enum<HTTPStatus>
-
- org.basex.http.HTTPStatus
-
- All Implemented Interfaces:
Serializable,Comparable<HTTPStatus>
public enum HTTPStatus extends Enum<HTTPStatus>
Enumeration with HTTP codes and error messages.- Author:
- BaseX Team 2005-23, BSD License, Christian Gruen
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BAD_REQUEST_XError: 400 (bad request).CREATED_XError: 201 (created).METHOD_NOT_SUPPORTED_XError 501, "Method not supported.".MULTIPLE_CONTEXTSError 400, "Multiple contexts supplied.".MULTIPLE_OPS_XError 400, "Multiple operations supplied".NO_DATABASE_SPECIFIEDError: 404, "No path specified".NO_RESTXQ_DIRECTORYError: 500, "RESTXQ path cannot be resolved.".NOT_FOUND_XError: 404 (not found).SERVICE_NOT_FOUNDError: 404, "Service not found".UNKNOWN_PARAM_XError 400, "Unknown parameter".
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description HTTPExceptionget(Object... ext)Returns an HTTP exception.static HTTPStatusvalueOf(String name)Returns the enum constant of this type with the specified name.static HTTPStatus[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
CREATED_X
public static final HTTPStatus CREATED_X
Error: 201 (created).
-
BAD_REQUEST_X
public static final HTTPStatus BAD_REQUEST_X
Error: 400 (bad request).
-
UNKNOWN_PARAM_X
public static final HTTPStatus UNKNOWN_PARAM_X
Error 400, "Unknown parameter".
-
MULTIPLE_OPS_X
public static final HTTPStatus MULTIPLE_OPS_X
Error 400, "Multiple operations supplied".
-
MULTIPLE_CONTEXTS
public static final HTTPStatus MULTIPLE_CONTEXTS
Error 400, "Multiple contexts supplied.".
-
NOT_FOUND_X
public static final HTTPStatus NOT_FOUND_X
Error: 404 (not found).
-
NO_DATABASE_SPECIFIED
public static final HTTPStatus NO_DATABASE_SPECIFIED
Error: 404, "No path specified".
-
SERVICE_NOT_FOUND
public static final HTTPStatus SERVICE_NOT_FOUND
Error: 404, "Service not found".
-
NO_RESTXQ_DIRECTORY
public static final HTTPStatus NO_RESTXQ_DIRECTORY
Error: 500, "RESTXQ path cannot be resolved.".
-
METHOD_NOT_SUPPORTED_X
public static final HTTPStatus METHOD_NOT_SUPPORTED_X
Error 501, "Method not supported.".
-
-
Method Detail
-
values
public static HTTPStatus[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (HTTPStatus c : HTTPStatus.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static HTTPStatus valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
get
public HTTPException get(Object... ext)
Returns an HTTP exception.- Parameters:
ext- extended info- Returns:
- HTTP exception
-
-