Class MIMEType

  • All Implemented Interfaces:
    Comparable<MIMEType>

    public class MIMEType
    extends Object
    implements Comparable<MIMEType>
    A MIME type with an optional q (quality) value.
    Author:
    Richard Cyganiak (richard@cyganiak.de)
    • Method Detail

      • parse

        public static MIMEType parse​(String mimeType)
        Parses the given MIME type string returning an instance of MIMEType. The expected format for mimeType is type/subtype[;q=x.y] . An example of valid mime type is: application/rdf+xml;q=0.9
        Parameters:
        mimeType - a provided mimetype string.
        Returns:
        the mime type instance.
        Throws:
        IllegalArgumentException - if the mimeType is not well formatted.
      • getMajorType

        public String getMajorType()
      • getSubtype

        public String getSubtype()
      • getFullType

        public String getFullType()
      • getQuality

        public double getQuality()
      • isAnyMajorType

        public boolean isAnyMajorType()
      • isAnySubtype

        public boolean isAnySubtype()