Interface MediaType


  • public interface MediaType
    Represent a Media type (rfc6838).
    Author:
    Julien Viet
    • Field Detail

      • APPLICATION

        static final MediaType APPLICATION
      • APPLICATION_OCTET_STREAM

        static final MediaType APPLICATION_OCTET_STREAM
      • APPLICATION_JSON

        static final MediaType APPLICATION_JSON
      • TEXT_PLAIN

        static final MediaType TEXT_PLAIN
    • Method Detail

      • parse

        static MediaType parse​(String s)
        Parse a media type.
        Parameters:
        s - the string representation
        Returns:
        the parsed media type or null when the string to parse is not valid
      • type

        String type()
        Returns:
        the type or null when everything is matched (*)
      • subType

        String subType()
        Returns:
        the sub type or null when everything is matched (*)
      • accepts

        boolean accepts​(MediaType other)
        Returns:
        whether the other mime type is accepted
      • parameter

        String parameter​(String name)
        Return a media type parameter
        Parameters:
        name - the parameter name
        Returns:
        the value or null