Class HeaderValues

java.lang.Object
io.helidon.http.HeaderValues

public final class HeaderValues extends Object
Values of commonly used headers.
  • Field Details

    • ACCEPT_RANGES_BYTES

      public static final Header ACCEPT_RANGES_BYTES
      Accept byte ranges for file download.
    • ACCEPT_RANGES_NONE

      public static final Header ACCEPT_RANGES_NONE
      Not accepting byte ranges for file download.
    • TRANSFER_ENCODING_CHUNKED

      public static final Header TRANSFER_ENCODING_CHUNKED
      Chunked transfer encoding. Used in HTTP/1.
    • CONNECTION_KEEP_ALIVE

      public static final Header CONNECTION_KEEP_ALIVE
      Connection keep-alive. Used in HTTP/1.
    • CONNECTION_CLOSE

      public static final Header CONNECTION_CLOSE
      Connection close. Used in HTTP/1.
    • CONTENT_TYPE_JSON

      public static final Header CONTENT_TYPE_JSON
      Content type application/json with no charset.
    • CONTENT_TYPE_TEXT_PLAIN

      public static final Header CONTENT_TYPE_TEXT_PLAIN
      Content type text plain with no charset.
    • CONTENT_TYPE_OCTET_STREAM

      public static final Header CONTENT_TYPE_OCTET_STREAM
      Content type octet stream.
    • CONTENT_TYPE_EVENT_STREAM

      public static final Header CONTENT_TYPE_EVENT_STREAM
      Content type SSE event stream.
    • ACCEPT_JSON

      public static final Header ACCEPT_JSON
      Accept application/json.
    • ACCEPT_TEXT

      public static final Header ACCEPT_TEXT
      Accept text/plain with UTF-8.
    • ACCEPT_EVENT_STREAM

      public static final Header ACCEPT_EVENT_STREAM
      Accept text/event-stream.
    • EXPECT_100

      public static final Header EXPECT_100
      Expect 100 header.
    • CONTENT_LENGTH_ZERO

      public static final Header CONTENT_LENGTH_ZERO
      Content length with 0 value.
    • CACHE_NO_CACHE

      public static final Header CACHE_NO_CACHE
      Cache control without any caching.
    • CACHE_NORMAL

      public static final Header CACHE_NORMAL
      Cache control that allows caching with no transform.
    • TE_TRAILERS

      public static final Header TE_TRAILERS
      TE header set to trailers, used to enable trailer headers.
  • Method Details

    • createCached

      public static Header createCached(String name, String value)
      Create and cache byte value. Use this method if the header value is stored in a constant, or used repeatedly.
      Parameters:
      name - header name
      value - value of the header
      Returns:
      a new header
    • createCached

      public static Header createCached(String name, int value)
      Create and cache byte value. Use this method if the header value is stored in a constant, or used repeatedly.
      Parameters:
      name - header name
      value - value of the header
      Returns:
      a new header
    • createCached

      public static Header createCached(String name, long value)
      Create and cache byte value. Use this method if the header value is stored in a constant, or used repeatedly.
      Parameters:
      name - header name
      value - value of the header
      Returns:
      a new header
    • createCached

      public static Header createCached(HeaderName name, String value)
      Create and cache byte value. Use this method if the header value is stored in a constant, or used repeatedly.
      Parameters:
      name - header name
      value - value of the header
      Returns:
      a new header
    • createCached

      public static Header createCached(HeaderName name, int value)
      Create and cache byte value. Use this method if the header value is stored in a constant, or used repeatedly.
      Parameters:
      name - header name
      value - value of the header
      Returns:
      a new header
    • createCached

      public static Header createCached(HeaderName name, long value)
      Create and cache byte value. Use this method if the header value is stored in a constant, or used repeatedly.
      Parameters:
      name - header name
      value - value of the header
      Returns:
      a new header
    • create

      public static Header create(HeaderName name, LazyString value)
      Create a new header with a single value. This header is considered unchanging and not sensitive.
      Parameters:
      name - name of the header
      value - lazy string with the value
      Returns:
      a new header
      See Also:
    • create

      public static Header create(HeaderName name, int value)
      Create a new header with a single value. This header is considered unchanging and not sensitive.
      Parameters:
      name - name of the header
      value - integer value of the header
      Returns:
      a new header
      See Also:
    • create

      public static Header create(HeaderName name, long value)
      Create a new header with a single value. This header is considered unchanging and not sensitive.
      Parameters:
      name - name of the header
      value - long value of the header
      Returns:
      a new header
      See Also:
    • create

      public static Header create(HeaderName name, String value)
      Create a new header with a single value. This header is considered unchanging and not sensitive.
      Parameters:
      name - name of the header
      value - value of the header
      Returns:
      a new header
      See Also:
    • create

      public static Header create(String name, String value)
      Create a new header with a single value. This header is considered unchanging and not sensitive.
      Parameters:
      name - name of the header
      value - value of the header
      Returns:
      a new header
      See Also:
    • create

      public static Header create(String name, int value)
      Create a new header with a single value. This header is considered unchanging and not sensitive.
      Parameters:
      name - name of the header
      value - value of the header
      Returns:
      a new header
      See Also:
    • create

      public static Header create(String name, long value)
      Create a new header with a single value. This header is considered unchanging and not sensitive.
      Parameters:
      name - name of the header
      value - value of the header
      Returns:
      a new header
      See Also:
    • create

      public static Header create(HeaderName name, String... values)
      Create a new header. This header is considered unchanging and not sensitive.
      Parameters:
      name - name of the header
      values - values of the header, must contain at least one value (which may be an empty String)
      Returns:
      a new header
      Throws:
      IllegalArgumentException - in case the collection is empty
      See Also:
    • create

      public static Header create(String name, String... values)
      Create a new header. This header is considered unchanging and not sensitive.
      Parameters:
      name - name of the header
      values - values of the header, must contain at least one value (which may be an empty String)
      Returns:
      a new header
      Throws:
      IllegalArgumentException - in case the collection is empty
      See Also:
    • create

      public static Header create(HeaderName name, Collection<String> values)
      Create a new header. This header is considered unchanging and not sensitive.
      Parameters:
      name - name of the header
      values - values of the header, must contain at least one value (which may be an empty String)
      Returns:
      a new header
      Throws:
      IllegalArgumentException - in case the collection is empty
      See Also:
    • create

      public static Header create(String name, Collection<String> values)
      Create a new header. This header is considered unchanging and not sensitive.
      Parameters:
      name - name of the header
      values - values of the header, must contain at least one value (which may be an empty String)
      Returns:
      a new header
      Throws:
      IllegalArgumentException - in case the collection is empty
      See Also:
    • createCached

      public static Header createCached(HeaderName name, boolean changing, boolean sensitive, String value)
      Create and cache byte value. Use this method if the header value is stored in a constant, or used repeatedly.
      Parameters:
      name - header name
      changing - whether the value is changing often (to disable caching for HTTP/2)
      sensitive - whether the value is sensitive (to disable caching for HTTP/2)
      value - value of the header
      Returns:
      a new header
    • create

      public static Header create(HeaderName name, boolean changing, boolean sensitive, String... values)
      Create a new header.
      Parameters:
      name - name of the header
      changing - whether the value is changing often (to disable caching for HTTP/2)
      sensitive - whether the value is sensitive (to disable caching for HTTP/2)
      values - value(s) of the header
      Returns:
      a new header
    • create

      public static Header create(HeaderName name, boolean changing, boolean sensitive, int value)
      Create a new header.
      Parameters:
      name - name of the header
      changing - whether the value is changing often (to disable caching for HTTP/2)
      sensitive - whether the value is sensitive (to disable caching for HTTP/2)
      value - value of the header
      Returns:
      a new header
    • create

      public static Header create(HeaderName name, boolean changing, boolean sensitive, long value)
      Create a new header.
      Parameters:
      name - name of the header
      changing - whether the value is changing often (to disable caching for HTTP/2)
      sensitive - whether the value is sensitive (to disable caching for HTTP/2)
      value - value of the header
      Returns:
      a new header