Enum Class HTTPCode

java.lang.Object
java.lang.Enum<HTTPCode>
org.basex.http.HTTPCode
All Implemented Interfaces:
Serializable, Comparable<HTTPCode>, java.lang.constant.Constable

public enum HTTPCode extends Enum<HTTPCode>
Enumeration with HTTP codes and error messages.
Author:
BaseX Team 2005-21, BSD License, Christian Gruen
  • Enum Constant Details

    • CREATED_X

      public static final HTTPCode CREATED_X
      Error: 201 (created).
    • BAD_REQUEST_X

      public static final HTTPCode BAD_REQUEST_X
      Error: 400 (bad request).
    • UNKNOWN_PARAM_X

      public static final HTTPCode UNKNOWN_PARAM_X
      Error 400, "Unknown parameter".
    • MULTIPLE_OPS_X

      public static final HTTPCode MULTIPLE_OPS_X
      Error 400, "Multiple operations supplied".
    • MULTIPLE_CONTEXTS

      public static final HTTPCode MULTIPLE_CONTEXTS
      Error 400, "Multiple contexts supplied.".
    • NOT_FOUND_X

      public static final HTTPCode NOT_FOUND_X
      Error: 404 (not found).
    • NO_DATABASE_SPECIFIED

      public static final HTTPCode NO_DATABASE_SPECIFIED
      Error: 404, "No path specified".
    • SERVICE_NOT_FOUND

      public static final HTTPCode SERVICE_NOT_FOUND
      Error: 404, "Service not found".
    • NO_RESTXQ_DIRECTORY

      public static final HTTPCode NO_RESTXQ_DIRECTORY
      Error: 500, "RESTXQ path cannot be resolved.".
    • METHOD_NOT_SUPPORTED_X

      public static final HTTPCode METHOD_NOT_SUPPORTED_X
      Error 501, "Method not supported.".
  • Method Details

    • values

      public static HTTPCode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static HTTPCode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null
    • get

      public HTTPException get(Object... ext)
      Returns an HTTP exception.
      Parameters:
      ext - extended info
      Returns:
      HTTP exception