Class ContentType


  • public class ContentType
    extends Object
    Handler for parsing Content-Types accepted by SDCri.

    This is currently limited to three content-types: text/xml, application/xml and application/soap+xml.

    • Method Detail

      • fromListMultimap

        public static Optional<ContentType> fromListMultimap​(com.google.common.collect.ListMultimap<String,​String> headers)
        Parses the content-type entry from a ListMultimap containing header entries. Http header keys must be lower case, i.e. content-type, not Content-Type/
        Parameters:
        headers - to parse content-type from
        Returns:
        parsed content-type if successful, empty optional otherwise
      • fromApache

        public static Optional<ContentType> fromApache​(@Nullable
                                                       org.apache.http.Header header)
        Parses the content-type Header element provided by apache http client.
        Parameters:
        header - to parse content-type from
        Returns:
        parsed content-type if parseable, empty optional otherweise
      • getCharset

        public Charset getCharset()
      • getBoundary

        public String getBoundary()