Class HTTP


  • public class HTTP
    extends java.lang.Object
    Constants and utilities relating to the HyperText Transfer Protocol (HTTP) as defined by RFC 2616, "Hypertext Transfer Protocol -- HTTP/1.1".

    Some status code comments used from Tomcat org.apache.catalina.servlets.WebdavServlet by Remy Maucherat Revision: 1.19 $ $Date: 2004/09/19 01:20:10.

    Author:
    Garret Wilson
    See Also:
    RFC 2616
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String ACCEPT_ENCODING_HEADER
      The HTTP header indicating the accepted encodings.
      static java.lang.String ACCEPT_HEADER
      The HTTP header indicating the accepted content types.
      static java.lang.String ACCEPT_LANGUAGE_HEADER
      The HTTP header indicating the accepted language types.
      static java.lang.String ALLOW_HEADER
      The HTTP header indicating the allowed methods.
      static java.lang.String AUTHORIZATION_HEADER
      The HTTP header indicating authorization information.
      static java.lang.String CACHE_CONTROL_HEADER
      The HTTP header for cache control.
      static java.nio.charset.Charset CHARSET
      The charset used for HTTP.
      static java.lang.String CHUNKED_TRANSFER_CODING
      The HTTP chunked transfer coding.
      static java.lang.String COMPRESS_CONTENT_CODING
      The HTTP compress content coding.
      static java.lang.String COMPRESS_TRANSFER_CODING
      The HTTP compress transfer coding.
      static java.lang.String CONNECTION_CLOSE
      The HTTP "close" Connection header value.
      static java.lang.String CONNECTION_HEADER
      The HTTP header indicating the connection persistency.
      static java.lang.String CONTENT_DESCRIPTION_HEADER
      The HTTP header indicating the content description.
      static java.lang.String CONTENT_DISPOSITION_HEADER
      The HTTP header indicating the content disposition.
      static java.lang.String CONTENT_ENCODING_HEADER
      The HTTP header indicating the content encoding.
      static java.lang.String CONTENT_LANGUAGE_HEADER
      The HTTP header indicating the natural language(s) of the intended audience for the enclosed entity.
      static java.lang.String CONTENT_LENGTH_HEADER
      The HTTP header indicating the size of the entity body.
      static java.lang.String CONTENT_LOCATION_HEADER
      The HTTP header indicating the canonical location of the resource.
      static java.lang.String CONTENT_MD5_HEADER
      The HTTP header indicating the MD5 digest of the body.
      static java.lang.String CONTENT_TYPE_HEADER
      The HTTP header indicating the content type.
      static char CR
      US-ASCII carriage return.
      static java.lang.String CRLF
      The CR+LF carriage return + linefeed combination.
      static Characters CTL_CHARACTERS
      US-ASCII control characters.
      static java.lang.String DATE_HEADER
      The HTTP header indicating the date of the message, in RFC 1123 format.
      static int DEFAULT_PORT
      The default HTTP port, 80.
      static int DEFAULT_SECURE_PORT
      The default HTTPS port, 143.
      static java.lang.String DEFLATE_CONTENT_CODING
      The HTTP deflate content coding.
      static java.lang.String DEFLATE_TRANSFER_CODING
      The HTTP deflate transfer coding.
      static java.lang.String DELETE_METHOD
      The HTTP DELETE method.
      static Characters DELIMITER_CHARACTERS
      Characters that delimit tokens.
      static char ESCAPE_CHAR
      The character used to escape quotation marks.
      static java.lang.String EXPIRES_HEADER
      The HTTP header indicating the expiration of the content.
      static java.lang.String GET_METHOD
      The HTTP GET method.
      static java.lang.String GZIP_CONTENT_CODING
      The HTTP gzip content coding.
      static java.lang.String GZIP_TRANSFER_CODING
      The HTTP gzip transfer coding.
      static java.lang.String HEAD_METHOD
      The HTTP HEAD method.
      static char HEADER_SEPARATOR
      The character which separates a header name from a header value.
      static java.lang.String HOST_HEADER
      The HTTP header indicating Internet host and port number of the resource being requested.
      static char HT
      US-ASCII horizontal tab.
      static java.lang.String HTTP_URI_SCHEME
      The HTTP scheme identifier.
      static java.lang.String HTTPS_URI_SCHEME
      The HTTPS scheme identifier.
      static java.lang.String IDENTITY_CONTENT_CODING
      The HTTP identity content coding.
      static java.lang.String IDENTITY_TRANSFER_CODING
      The HTTP identity transfer coding.
      static java.lang.String IF_MODIFIED_SINCE_HEADER
      The HTTP header indicating content should be retrieved only if it has been modified after a certain date.
      static java.lang.String IF_UNMODIFIED_SINCE_HEADER
      The HTTP header indicating content should be retrieved only if it has not been modified after a certain date.
      static java.lang.String LAST_MODIFIED_HEADER
      The HTTP header indicating the date and time at which the origin server believes the variant was last modified.
      static char LF
      US-ASCII linefeed.
      static char LIST_DELIMITER
      The character for delimiting HTTP list items.
      static java.util.regex.Pattern LIST_DELIMITER_PATTERN
      The regular expression pattern for the character for delimiting HTTP list items.
      static java.util.regex.Pattern LIST_ELEMENT_WEIGHT_PATTERN
      The regular expression pattern for a weighted list element.
      static java.lang.String LOCATION_HEADER
      The HTTP header indicating the destination of a redirection.
      static Characters LWS_CHARACTERS
      Linear whitespace characters which can, in the correct sequence, be folded into single spaces.
      static java.lang.String LWS_REGULAR_EXPRESSION
      The regular expression string matching linear whitespace.
      static java.lang.String MAX_AGE_CACHE_CONTROL
      The HTTP max-age cache control header.
      static java.lang.String MAX_STALE_CACHE_CONTROL
      The HTTP max-stale cache control header.
      static java.lang.String MIN_FRESH_CACHE_CONTROL
      The HTTP min-fresh cache control header.
      static java.lang.String MUST_REVALIDATE_CACHE_CONTROL
      The HTTP must-revalidate cache control header.
      static java.lang.String NO_CACHE_CACHE_CONTROL
      The HTTP no-cache cache control header.
      static java.lang.String NO_CACHE_PRAGMA
      The HTTP no-cache pragma.
      static java.lang.String NO_STORE_CACHE_CONTROL
      The HTTP no-store cache control header.
      static java.lang.String NO_TRANSFORM_CACHE_CONTROL
      The HTTP no-transform cache control header.
      static java.lang.String OPTIONS_METHOD
      The HTTP OPTIONS method.
      static char PARAMETER_DELIMITER
      The character for delimiting parameters, such as qvalue weights in lists.
      static java.lang.String POST_METHOD
      The HTTP POST method.
      static java.lang.String PRAGMA_HEADER
      The HTTP pragma header.
      static java.lang.String PRODUCT_VERSION_REGEX
      The regular expression for a product version in the form X.X.X, where all but the first version is optional.
      static java.lang.String PROXY_REVALIDATE_CACHE_CONTROL
      The HTTP proxy-revalidate cache control header.
      static java.lang.String PUT_METHOD
      The HTTP PUT method.
      static char QUOTE
      US-ASCII double-quote mark.
      static java.lang.String REALM_PARAMETER
      The "realm" parameter used in headers such as WWW-Authenticate.
      static java.lang.String REFERER_HEADER
      The HTTP header indicating the referring location.
      static java.lang.String S_MAXAGE_CACHE_CONTROL
      The HTTP s-maxage cache control header.
      static int SC_ACCEPTED
      Status code (202) indicating that a request was accepted for processing, but was not completed.
      static int SC_BAD_GATEWAY
      Status code (502) indicating that the HTTP server received an invalid response from a server it consulted when acting as a proxy or gateway.
      static int SC_BAD_REQUEST
      Status code (400) indicating the request sent by the client was syntactically incorrect.
      static int SC_CONFLICT
      Status code (409) indicating that the request could not be completed due to a conflict with the current state of the resource.
      static int SC_CONTINUE
      Status code (100) indicating the client may continue with its request.
      static int SC_CREATED
      Status code (201) indicating the request succeeded and created a new resource on the server.
      static int SC_FORBIDDEN
      Status code (403) indicating the server understood the request but refused to fulfill it.
      static int SC_GONE
      Status code (410) indicating that the requested resource is no longer available at the server and no forwarding address is known.
      static int SC_INTERNAL_SERVER_ERROR
      Status code (500) indicating an error inside the HTTP service which prevented it from fulfilling the request.
      static int SC_LENGTH_REQUIRED
      Status code (411) indicating that the server refuses to accept the request without a defined Content-Length.
      static int SC_METHOD_NOT_ALLOWED
      Status code (405) indicating the method specified is not allowed for the resource.
      static int SC_MOVED_PERMANENTLY
      Status code (301) indicating that the resource has permanently moved to a new location, and that future references should use a new URI with their requests.
      static int SC_MOVED_TEMPORARILY
      Status code (302) indicating that the resource has temporarily moved to another location, but that future references should still use the original URI to access the resource.
      static int SC_NO_CONTENT
      Status code (204) indicating that the request succeeded but that there was no new information to return.
      static int SC_NOT_FOUND
      Status code (404) indicating that the requested resource is not available.
      static int SC_NOT_IMPLEMENTED
      Status code (501) indicating the HTTP service does not support the functionality needed to fulfill the request.
      static int SC_NOT_MODIFIED
      Status code (304) indicating that a conditional GET operation found that the resource was available and not modified.
      static int SC_OK
      Status code (200) indicating the request succeeded normally.
      static int SC_PRECONDITION_FAILED
      Status code (412) indicating the precondition given in one or more of the request-header fields evaluated to false when it was tested on the server.
      static int SC_REQUEST_ENTITY_TOO_LARGE
      Status code (413) indicating the server is refusing to process a request because the request entity is larger than the server is willing or able to process.
      static int SC_SERVICE_UNAVAILABLE
      Status code (503) indicating that the HTTP service is temporarily overloaded, and unable to handle the request.
      static int SC_UNAUTHORIZED
      Status code (401) indicating that the request requires HTTP authentication.
      static int SC_UNSUPPORTED_MEDIA_TYPE
      Status code (415) indicating the server is refusing to service the request because the entity of the request is in a format not supported by the requested resource for the requested method.
      static Characters SEPARATOR_CHARACTERS
      Characters that must be in a quoted string to be included in a parameter value.
      static char SP
      US-ASCII space.
      static java.lang.String TE_HEADER
      The HTTP header indicating what extension transfer-codings it is willing to accept in the response and whether or not it is willing to accept trailer fields in a chunked transfer-coding.
      static java.lang.String TRACE_METHOD
      The HTTP TRACE method.
      static java.lang.String TRANSFER_ENCODING_HEADER
      The HTTP header indicating the what (if any) type of transformation has been applied to the message body in order to safely transfer it between the sender and the recipient.
      static java.lang.String USER_AGENT_HEADER
      The HTTP header indicating the user agent.
      static char VERSION_DELIMITER
      The character '.' which separates components of an HTTP version.
      static java.lang.String VERSION_IDENTIFIER
      The string "HTTP" begins an HTTP version.
      static char VERSION_SEPARATOR
      The character '/' which separates the letters "HTTP" from the HTTP version.
      static char WILDCARD_CHAR
      The HTTP character used as a wildcard.
      static java.lang.String WWW_AUTHENTICATE_HEADER
      The HTTP header indicating the credentials expected by the server.
    • Constructor Summary

      Constructors 
      Constructor Description
      HTTP()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean isHTTPScheme​(java.lang.String scheme)
      Determines if the given scheme is an HTTP scheme, either "http" or "https".
      static boolean isHTTPURI​(java.net.URI uri)
      Determines if the given URI has an HTTP scheme, either "http" or "https".
      static java.net.URI matchSchemeSecurity​(java.net.URI uri, java.net.URI matchURI)
      Makes sure that a URI matches the security or non-security of its scheme with that of another URI.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • HTTP_URI_SCHEME

        public static final java.lang.String HTTP_URI_SCHEME
        The HTTP scheme identifier.
        See Also:
        Constant Field Values
      • HTTPS_URI_SCHEME

        public static final java.lang.String HTTPS_URI_SCHEME
        The HTTPS scheme identifier.
        See Also:
        Constant Field Values
      • DEFAULT_PORT

        public static final int DEFAULT_PORT
        The default HTTP port, 80.
        See Also:
        Constant Field Values
      • DEFAULT_SECURE_PORT

        public static final int DEFAULT_SECURE_PORT
        The default HTTPS port, 143.
        See Also:
        Constant Field Values
      • CHARSET

        public static final java.nio.charset.Charset CHARSET
        The charset used for HTTP.
      • ALLOW_HEADER

        public static final java.lang.String ALLOW_HEADER
        The HTTP header indicating the allowed methods.
        See Also:
        Constant Field Values
      • ACCEPT_HEADER

        public static final java.lang.String ACCEPT_HEADER
        The HTTP header indicating the accepted content types.
        See Also:
        Constant Field Values
      • ACCEPT_ENCODING_HEADER

        public static final java.lang.String ACCEPT_ENCODING_HEADER
        The HTTP header indicating the accepted encodings.
        See Also:
        Constant Field Values
      • ACCEPT_LANGUAGE_HEADER

        public static final java.lang.String ACCEPT_LANGUAGE_HEADER
        The HTTP header indicating the accepted language types.
        See Also:
        Constant Field Values
      • AUTHORIZATION_HEADER

        public static final java.lang.String AUTHORIZATION_HEADER
        The HTTP header indicating authorization information.
        See Also:
        Constant Field Values
      • CACHE_CONTROL_HEADER

        public static final java.lang.String CACHE_CONTROL_HEADER
        The HTTP header for cache control.
        See Also:
        Constant Field Values
      • MAX_AGE_CACHE_CONTROL

        public static final java.lang.String MAX_AGE_CACHE_CONTROL
        The HTTP max-age cache control header.
        See Also:
        Constant Field Values
      • MAX_STALE_CACHE_CONTROL

        public static final java.lang.String MAX_STALE_CACHE_CONTROL
        The HTTP max-stale cache control header.
        See Also:
        Constant Field Values
      • MIN_FRESH_CACHE_CONTROL

        public static final java.lang.String MIN_FRESH_CACHE_CONTROL
        The HTTP min-fresh cache control header.
        See Also:
        Constant Field Values
      • MUST_REVALIDATE_CACHE_CONTROL

        public static final java.lang.String MUST_REVALIDATE_CACHE_CONTROL
        The HTTP must-revalidate cache control header.
        See Also:
        Constant Field Values
      • NO_CACHE_CACHE_CONTROL

        public static final java.lang.String NO_CACHE_CACHE_CONTROL
        The HTTP no-cache cache control header.
        See Also:
        Constant Field Values
      • NO_STORE_CACHE_CONTROL

        public static final java.lang.String NO_STORE_CACHE_CONTROL
        The HTTP no-store cache control header.
        See Also:
        Constant Field Values
      • NO_TRANSFORM_CACHE_CONTROL

        public static final java.lang.String NO_TRANSFORM_CACHE_CONTROL
        The HTTP no-transform cache control header.
        See Also:
        Constant Field Values
      • PROXY_REVALIDATE_CACHE_CONTROL

        public static final java.lang.String PROXY_REVALIDATE_CACHE_CONTROL
        The HTTP proxy-revalidate cache control header.
        See Also:
        Constant Field Values
      • S_MAXAGE_CACHE_CONTROL

        public static final java.lang.String S_MAXAGE_CACHE_CONTROL
        The HTTP s-maxage cache control header.
        See Also:
        Constant Field Values
      • CONNECTION_HEADER

        public static final java.lang.String CONNECTION_HEADER
        The HTTP header indicating the connection persistency.
        See Also:
        Constant Field Values
      • CONNECTION_CLOSE

        public static final java.lang.String CONNECTION_CLOSE
        The HTTP "close" Connection header value.
        See Also:
        Constant Field Values
      • CONTENT_DESCRIPTION_HEADER

        public static final java.lang.String CONTENT_DESCRIPTION_HEADER
        The HTTP header indicating the content description.
        See Also:
        Constant Field Values
      • CONTENT_DISPOSITION_HEADER

        public static final java.lang.String CONTENT_DISPOSITION_HEADER
        The HTTP header indicating the content disposition.
        See Also:
        Constant Field Values
      • CONTENT_ENCODING_HEADER

        public static final java.lang.String CONTENT_ENCODING_HEADER
        The HTTP header indicating the content encoding.
        See Also:
        Constant Field Values
      • COMPRESS_CONTENT_CODING

        public static final java.lang.String COMPRESS_CONTENT_CODING
        The HTTP compress content coding.
        See Also:
        Constant Field Values
      • DEFLATE_CONTENT_CODING

        public static final java.lang.String DEFLATE_CONTENT_CODING
        The HTTP deflate content coding.
        See Also:
        Constant Field Values
      • GZIP_CONTENT_CODING

        public static final java.lang.String GZIP_CONTENT_CODING
        The HTTP gzip content coding.
        See Also:
        Constant Field Values
      • IDENTITY_CONTENT_CODING

        public static final java.lang.String IDENTITY_CONTENT_CODING
        The HTTP identity content coding.
        See Also:
        Constant Field Values
      • CONTENT_LANGUAGE_HEADER

        public static final java.lang.String CONTENT_LANGUAGE_HEADER
        The HTTP header indicating the natural language(s) of the intended audience for the enclosed entity.
        See Also:
        Constant Field Values
      • CONTENT_LENGTH_HEADER

        public static final java.lang.String CONTENT_LENGTH_HEADER
        The HTTP header indicating the size of the entity body.
        See Also:
        Constant Field Values
      • CONTENT_LOCATION_HEADER

        public static final java.lang.String CONTENT_LOCATION_HEADER
        The HTTP header indicating the canonical location of the resource.
        See Also:
        Constant Field Values
      • CONTENT_MD5_HEADER

        public static final java.lang.String CONTENT_MD5_HEADER
        The HTTP header indicating the MD5 digest of the body.
        See Also:
        Constant Field Values
      • CONTENT_TYPE_HEADER

        public static final java.lang.String CONTENT_TYPE_HEADER
        The HTTP header indicating the content type.
        See Also:
        Constant Field Values
      • DATE_HEADER

        public static final java.lang.String DATE_HEADER
        The HTTP header indicating the date of the message, in RFC 1123 format.
        See Also:
        Constant Field Values
      • EXPIRES_HEADER

        public static final java.lang.String EXPIRES_HEADER
        The HTTP header indicating the expiration of the content.
        See Also:
        Constant Field Values
      • HOST_HEADER

        public static final java.lang.String HOST_HEADER
        The HTTP header indicating Internet host and port number of the resource being requested.
        See Also:
        Constant Field Values
      • IF_MODIFIED_SINCE_HEADER

        public static final java.lang.String IF_MODIFIED_SINCE_HEADER
        The HTTP header indicating content should be retrieved only if it has been modified after a certain date.
        See Also:
        Constant Field Values
      • IF_UNMODIFIED_SINCE_HEADER

        public static final java.lang.String IF_UNMODIFIED_SINCE_HEADER
        The HTTP header indicating content should be retrieved only if it has not been modified after a certain date.
        See Also:
        Constant Field Values
      • LAST_MODIFIED_HEADER

        public static final java.lang.String LAST_MODIFIED_HEADER
        The HTTP header indicating the date and time at which the origin server believes the variant was last modified.
        See Also:
        Constant Field Values
      • LOCATION_HEADER

        public static final java.lang.String LOCATION_HEADER
        The HTTP header indicating the destination of a redirection.
        See Also:
        Constant Field Values
      • PRAGMA_HEADER

        public static final java.lang.String PRAGMA_HEADER
        The HTTP pragma header.
        See Also:
        Constant Field Values
      • NO_CACHE_PRAGMA

        public static final java.lang.String NO_CACHE_PRAGMA
        The HTTP no-cache pragma.
        See Also:
        Constant Field Values
      • REFERER_HEADER

        public static final java.lang.String REFERER_HEADER
        The HTTP header indicating the referring location.
        See Also:
        Constant Field Values
      • TE_HEADER

        public static final java.lang.String TE_HEADER
        The HTTP header indicating what extension transfer-codings it is willing to accept in the response and whether or not it is willing to accept trailer fields in a chunked transfer-coding.
        See Also:
        Constant Field Values
      • TRANSFER_ENCODING_HEADER

        public static final java.lang.String TRANSFER_ENCODING_HEADER
        The HTTP header indicating the what (if any) type of transformation has been applied to the message body in order to safely transfer it between the sender and the recipient.
        See Also:
        Constant Field Values
      • CHUNKED_TRANSFER_CODING

        public static final java.lang.String CHUNKED_TRANSFER_CODING
        The HTTP chunked transfer coding.
        See Also:
        Constant Field Values
      • COMPRESS_TRANSFER_CODING

        public static final java.lang.String COMPRESS_TRANSFER_CODING
        The HTTP compress transfer coding.
        See Also:
        Constant Field Values
      • DEFLATE_TRANSFER_CODING

        public static final java.lang.String DEFLATE_TRANSFER_CODING
        The HTTP deflate transfer coding.
        See Also:
        Constant Field Values
      • GZIP_TRANSFER_CODING

        public static final java.lang.String GZIP_TRANSFER_CODING
        The HTTP gzip transfer coding.
        See Also:
        Constant Field Values
      • IDENTITY_TRANSFER_CODING

        public static final java.lang.String IDENTITY_TRANSFER_CODING
        The HTTP identity transfer coding.
        See Also:
        Constant Field Values
      • USER_AGENT_HEADER

        public static final java.lang.String USER_AGENT_HEADER
        The HTTP header indicating the user agent.
        See Also:
        Constant Field Values
      • WWW_AUTHENTICATE_HEADER

        public static final java.lang.String WWW_AUTHENTICATE_HEADER
        The HTTP header indicating the credentials expected by the server.
        See Also:
        Constant Field Values
      • GET_METHOD

        public static final java.lang.String GET_METHOD
        The HTTP GET method.
        See Also:
        Constant Field Values
      • POST_METHOD

        public static final java.lang.String POST_METHOD
        The HTTP POST method.
        See Also:
        Constant Field Values
      • HEAD_METHOD

        public static final java.lang.String HEAD_METHOD
        The HTTP HEAD method.
        See Also:
        Constant Field Values
      • OPTIONS_METHOD

        public static final java.lang.String OPTIONS_METHOD
        The HTTP OPTIONS method.
        See Also:
        Constant Field Values
      • PUT_METHOD

        public static final java.lang.String PUT_METHOD
        The HTTP PUT method.
        See Also:
        Constant Field Values
      • DELETE_METHOD

        public static final java.lang.String DELETE_METHOD
        The HTTP DELETE method.
        See Also:
        Constant Field Values
      • TRACE_METHOD

        public static final java.lang.String TRACE_METHOD
        The HTTP TRACE method.
        See Also:
        Constant Field Values
      • REALM_PARAMETER

        public static final java.lang.String REALM_PARAMETER
        The "realm" parameter used in headers such as WWW-Authenticate.
        See Also:
        Constant Field Values
      • SC_CONTINUE

        public static final int SC_CONTINUE
        Status code (100) indicating the client may continue with its request. This interim response is used to inform the client that the initial part of the request has been received and has not yet been rejected by the server.
        See Also:
        Constant Field Values
      • SC_OK

        public static final int SC_OK
        Status code (200) indicating the request succeeded normally.
        See Also:
        Constant Field Values
      • SC_CREATED

        public static final int SC_CREATED
        Status code (201) indicating the request succeeded and created a new resource on the server.
        See Also:
        Constant Field Values
      • SC_ACCEPTED

        public static final int SC_ACCEPTED
        Status code (202) indicating that a request was accepted for processing, but was not completed.
        See Also:
        Constant Field Values
      • SC_NO_CONTENT

        public static final int SC_NO_CONTENT
        Status code (204) indicating that the request succeeded but that there was no new information to return.
        See Also:
        Constant Field Values
      • SC_MOVED_PERMANENTLY

        public static final int SC_MOVED_PERMANENTLY
        Status code (301) indicating that the resource has permanently moved to a new location, and that future references should use a new URI with their requests.
        See Also:
        Constant Field Values
      • SC_MOVED_TEMPORARILY

        public static final int SC_MOVED_TEMPORARILY
        Status code (302) indicating that the resource has temporarily moved to another location, but that future references should still use the original URI to access the resource.
        See Also:
        Constant Field Values
      • SC_NOT_MODIFIED

        public static final int SC_NOT_MODIFIED
        Status code (304) indicating that a conditional GET operation found that the resource was available and not modified.
        See Also:
        Constant Field Values
      • SC_BAD_REQUEST

        public static final int SC_BAD_REQUEST
        Status code (400) indicating the request sent by the client was syntactically incorrect.
        See Also:
        Constant Field Values
      • SC_UNAUTHORIZED

        public static final int SC_UNAUTHORIZED
        Status code (401) indicating that the request requires HTTP authentication.
        See Also:
        Constant Field Values
      • SC_FORBIDDEN

        public static final int SC_FORBIDDEN
        Status code (403) indicating the server understood the request but refused to fulfill it.
        See Also:
        Constant Field Values
      • SC_NOT_FOUND

        public static final int SC_NOT_FOUND
        Status code (404) indicating that the requested resource is not available.
        See Also:
        Constant Field Values
      • SC_METHOD_NOT_ALLOWED

        public static final int SC_METHOD_NOT_ALLOWED
        Status code (405) indicating the method specified is not allowed for the resource.
        See Also:
        Constant Field Values
      • SC_CONFLICT

        public static final int SC_CONFLICT
        Status code (409) indicating that the request could not be completed due to a conflict with the current state of the resource.
        See Also:
        Constant Field Values
      • SC_GONE

        public static final int SC_GONE
        Status code (410) indicating that the requested resource is no longer available at the server and no forwarding address is known.
        See Also:
        Constant Field Values
      • SC_LENGTH_REQUIRED

        public static final int SC_LENGTH_REQUIRED
        Status code (411) indicating that the server refuses to accept the request without a defined Content-Length.
        See Also:
        Constant Field Values
      • SC_PRECONDITION_FAILED

        public static final int SC_PRECONDITION_FAILED
        Status code (412) indicating the precondition given in one or more of the request-header fields evaluated to false when it was tested on the server.
        See Also:
        Constant Field Values
      • SC_REQUEST_ENTITY_TOO_LARGE

        public static final int SC_REQUEST_ENTITY_TOO_LARGE
        Status code (413) indicating the server is refusing to process a request because the request entity is larger than the server is willing or able to process.
        See Also:
        Constant Field Values
      • SC_UNSUPPORTED_MEDIA_TYPE

        public static final int SC_UNSUPPORTED_MEDIA_TYPE
        Status code (415) indicating the server is refusing to service the request because the entity of the request is in a format not supported by the requested resource for the requested method.
        See Also:
        Constant Field Values
      • SC_INTERNAL_SERVER_ERROR

        public static final int SC_INTERNAL_SERVER_ERROR
        Status code (500) indicating an error inside the HTTP service which prevented it from fulfilling the request.
        See Also:
        Constant Field Values
      • SC_NOT_IMPLEMENTED

        public static final int SC_NOT_IMPLEMENTED
        Status code (501) indicating the HTTP service does not support the functionality needed to fulfill the request.
        See Also:
        Constant Field Values
      • SC_BAD_GATEWAY

        public static final int SC_BAD_GATEWAY
        Status code (502) indicating that the HTTP server received an invalid response from a server it consulted when acting as a proxy or gateway.
        See Also:
        Constant Field Values
      • SC_SERVICE_UNAVAILABLE

        public static final int SC_SERVICE_UNAVAILABLE
        Status code (503) indicating that the HTTP service is temporarily overloaded, and unable to handle the request.
        See Also:
        Constant Field Values
      • VERSION_DELIMITER

        public static final char VERSION_DELIMITER
        The character '.' which separates components of an HTTP version.
        See Also:
        Constant Field Values
      • VERSION_SEPARATOR

        public static final char VERSION_SEPARATOR
        The character '/' which separates the letters "HTTP" from the HTTP version.
        See Also:
        Constant Field Values
      • VERSION_IDENTIFIER

        public static final java.lang.String VERSION_IDENTIFIER
        The string "HTTP" begins an HTTP version.
        See Also:
        Constant Field Values
      • LIST_DELIMITER

        public static final char LIST_DELIMITER
        The character for delimiting HTTP list items.
        See Also:
        Constant Field Values
      • LIST_DELIMITER_PATTERN

        public static final java.util.regex.Pattern LIST_DELIMITER_PATTERN
        The regular expression pattern for the character for delimiting HTTP list items.
      • PARAMETER_DELIMITER

        public static final char PARAMETER_DELIMITER
        The character for delimiting parameters, such as qvalue weights in lists.
        See Also:
        Constant Field Values
      • HEADER_SEPARATOR

        public static final char HEADER_SEPARATOR
        The character which separates a header name from a header value.
        See Also:
        Constant Field Values
      • ESCAPE_CHAR

        public static final char ESCAPE_CHAR
        The character used to escape quotation marks.
        See Also:
        Constant Field Values
      • WILDCARD_CHAR

        public static final char WILDCARD_CHAR
        The HTTP character used as a wildcard.
        See Also:
        Constant Field Values
      • CTL_CHARACTERS

        public static final Characters CTL_CHARACTERS
        US-ASCII control characters.
      • CRLF

        public static final java.lang.String CRLF
        The CR+LF carriage return + linefeed combination.
        See Also:
        Constant Field Values
      • SEPARATOR_CHARACTERS

        public static final Characters SEPARATOR_CHARACTERS
        Characters that must be in a quoted string to be included in a parameter value.
      • DELIMITER_CHARACTERS

        public static final Characters DELIMITER_CHARACTERS
        Characters that delimit tokens.
      • LWS_CHARACTERS

        public static final Characters LWS_CHARACTERS
        Linear whitespace characters which can, in the correct sequence, be folded into single spaces.
      • LWS_REGULAR_EXPRESSION

        public static final java.lang.String LWS_REGULAR_EXPRESSION
        The regular expression string matching linear whitespace.
        See Also:
        Constant Field Values
      • LIST_ELEMENT_WEIGHT_PATTERN

        public static final java.util.regex.Pattern LIST_ELEMENT_WEIGHT_PATTERN
        The regular expression pattern for a weighted list element. Matching group 1 is the list element. Matching group 2 is the quality value, which may be null if no quality value is present.
      • PRODUCT_VERSION_REGEX

        public static final java.lang.String PRODUCT_VERSION_REGEX
        The regular expression for a product version in the form X.X.X, where all but the first version is optional. Each group represents a numeric segment of the version string. This regular expression accepts versions with letters, such as "7.0b" and "1.23b2", in which case the letters and everything after are not included in the groups. This regular expression therefore accepts "6.0", "7.0b", "8.9.10", and "2.17b3".
        See Also:
        Constant Field Values
    • Constructor Detail

      • HTTP

        public HTTP()
    • Method Detail

      • isHTTPURI

        public static boolean isHTTPURI​(java.net.URI uri)
        Determines if the given URI has an HTTP scheme, either "http" or "https".
        Parameters:
        uri - The URI the scheme of which to test.
        Returns:
        true if the given URI has a scheme designating HTTP or secure HTTP.
        See Also:
        isHTTPScheme(String), HTTP_URI_SCHEME, HTTPS_URI_SCHEME
      • isHTTPScheme

        public static boolean isHTTPScheme​(java.lang.String scheme)
        Determines if the given scheme is an HTTP scheme, either "http" or "https".
        Parameters:
        scheme - The scheme to test.
        Returns:
        true if the given scheme designates HTTP or secure HTTP.
        Throws:
        java.lang.NullPointerException - if the given scheme is null.
        See Also:
        HTTP_URI_SCHEME, HTTPS_URI_SCHEME
      • matchSchemeSecurity

        public static java.net.URI matchSchemeSecurity​(java.net.URI uri,
                                                       java.net.URI matchURI)
        Makes sure that a URI matches the security or non-security of its scheme with that of another URI. That is, if both URIs have HTTP schemes, the scheme of the URI is made to match the scheme ("http" or "https") of the other URI.
        Parameters:
        uri - The URI to change.
        matchURI - The URI the scheme of which to match.
        Returns:
        A URI with a scheme matching the match URI, if both are already HTTP URIs.
        See Also:
        isHTTPURI(URI), HTTP_URI_SCHEME, HTTPS_URI_SCHEME