Class HttpUtils


  • public final class HttpUtils
    extends Object
    HTTP utility methods and constants.
    • Field Detail

      • CONTENT_DISPOSITION

        public static final String CONTENT_DISPOSITION
        the HTTP header for Content-Disposition.
        See Also:
        Constant Field Values
      • PARAM_ACTION

        public static final String PARAM_ACTION
        the HTTP request parameter for an action.
      • PARAM_FIELDS

        public static final String PARAM_FIELDS
        the HTTP request parameter to specify which fields to return.
      • PARAM_MIME_TYPE

        public static final String PARAM_MIME_TYPE
        the HTTP request parameter to request a certain mimetype for a field.
      • PARAM_PAGE_SIZE

        public static final String PARAM_PAGE_SIZE
        the HTTP request parameter to request a certain page size.
      • PARAM_PAGED_RESULTS_COOKIE

        public static final String PARAM_PAGED_RESULTS_COOKIE
        the HTTP request parameter to specify a paged results cookie.
      • PARAM_PAGED_RESULTS_OFFSET

        public static final String PARAM_PAGED_RESULTS_OFFSET
        the HTTP request parameter to specify a paged results offset.
      • PARAM_PRETTY_PRINT

        public static final String PARAM_PRETTY_PRINT
        the HTTP request parameter to request pretty printing.
        See Also:
        Constant Field Values
      • PARAM_QUERY_EXPRESSION

        public static final String PARAM_QUERY_EXPRESSION
        the HTTP request parameter to specify a query expression.
      • PARAM_QUERY_FILTER

        public static final String PARAM_QUERY_FILTER
        the HTTP request parameter to specify a query filter.
      • PARAM_QUERY_ID

        public static final String PARAM_QUERY_ID
        the HTTP request parameter to specify a query id.
      • PARAM_SORT_KEYS

        public static final String PARAM_SORT_KEYS
        the HTTP request parameter to specify the sort keys.
      • PARAM_TOTAL_PAGED_RESULTS_POLICY

        public static final String PARAM_TOTAL_PAGED_RESULTS_POLICY
        The policy used for counting total paged results.
      • PARAM_COUNT_ONLY

        public static final String PARAM_COUNT_ONLY
        the HTTP request parameter to request only the count of results.
      • PARAM_CREST_API

        public static final String PARAM_CREST_API
        Request the CREST API Descriptor.
      • PROTOCOL_VERSION_1

        public static final Version PROTOCOL_VERSION_1
        Protocol Version 1.
      • PROTOCOL_VERSION_2

        public static final Version PROTOCOL_VERSION_2
        Protocol Version 2 - supports upsert on PUT.
      • PROTOCOL_VERSION_2_1

        public static final Version PROTOCOL_VERSION_2_1
        Protocol Version 2.1 - supports defacto standard for create requests when the ID of the created resource is to be allocated by the server, which are represented as a POST to the collection endpoint without an _action query parameter.
      • PROTOCOL_VERSION_2_2

        public static final Version PROTOCOL_VERSION_2_2
        Protocol Version 2.2 - supports _countOnly parameter on query requests to indicate that only a count of the resources matching the supplied query filter on the resource collection are returned.
      • DEFAULT_PROTOCOL_VERSION

        public static final Version DEFAULT_PROTOCOL_VERSION
        The default version of the named protocol.
    • Method Detail

      • determineRequestType

        public static RequestType determineRequestType​(Request request)
                                                throws ResourceException
        Determines which CREST operation (CRUDPAQ) of the incoming request.
        Parameters:
        request - The request.
        Returns:
        The Operation.
        Throws:
        ResourceException - If the request operation could not be determined or is not supported.