Class MediaType

    • Field Detail

      • TEXT_PLAIN

        public static final MediaType TEXT_PLAIN
        Deprecated.
        The text/plain media type.
      • TEXT_PLAIN_UTF_8

        public static final MediaType TEXT_PLAIN_UTF_8
        Deprecated.
        The text/plain; charset=UTF-8 media type.
      • APPLICATION_JSON

        public static final MediaType APPLICATION_JSON
        Deprecated.
        The application/json media type.
      • APPLICATION_JSON_UTF_8

        @Deprecated
        @API(status=DEPRECATED,
             since="5.14")
        public static final MediaType APPLICATION_JSON_UTF_8
        Deprecated.
        Use APPLICATION_JSON instead.
        The application/json; charset=UTF-8 media type.
      • APPLICATION_OCTET_STREAM

        public static final MediaType APPLICATION_OCTET_STREAM
        Deprecated.
        The application/octet-stream media type.
      • IMAGE_JPEG

        public static final MediaType IMAGE_JPEG
        Deprecated.
        The image/jpeg media type.
      • IMAGE_PNG

        public static final MediaType IMAGE_PNG
        Deprecated.
        The image/png media type.
    • Method Detail

      • parse

        public static MediaType parse​(java.lang.String value)
        Deprecated.
        Parse the given media type value.

        Must be valid according to RFC 2045.

        Parameters:
        value - the media type value to parse; never null or blank
        Returns:
        the parsed media type
        Throws:
        org.junit.platform.commons.PreconditionViolationException - if the value is not a valid media type
      • create

        public static MediaType create​(java.lang.String type,
                                       java.lang.String subtype)
        Deprecated.
        Create a media type with the given type and subtype.
        Parameters:
        type - the type; never null or blank
        subtype - the subtype; never null or blank
        Returns:
        the media type
      • create

        public static MediaType create​(java.lang.String type,
                                       java.lang.String subtype,
                                       java.nio.charset.Charset charset)
        Deprecated.
        Create a media type with the given type, subtype, and charset.
        Parameters:
        type - the type; never null or blank
        subtype - the subtype; never null or blank
        charset - the charset; never null
        Returns:
        the media type