Class EntityReaderBase<T>

java.lang.Object
io.helidon.http.media.EntityReaderBase<T>
Type Parameters:
T - type of the supported objects
All Implemented Interfaces:
EntityReader<T>

public abstract class EntityReaderBase<T> extends Object implements EntityReader<T>
Base for readers that care about charset.
  • Constructor Details

    • EntityReaderBase

      protected EntityReaderBase()
      Constructor with no side effects.
  • Method Details

    • contentTypeCharset

      protected static Charset contentTypeCharset(Headers headers)
      Get Content-Type from the provided headers (if available), then get its charset (if available), and return it, otherwise return UTF-8.
      Parameters:
      headers - headers that are expected to contain Content-Type header
      Returns:
      charset either from the header, or the default value provided
    • findContentTypeCharset

      protected static Optional<Charset> findContentTypeCharset(Headers headers)
      Get Content-Type from the provided headers (if available), then get its charset (if available), and return it, otherwise return empty optional.
      Parameters:
      headers - headers that are expected to contain Content-Type header
      Returns:
      charset from the header, or an empty optional