Class ContentType


  • public class ContentType
    extends java.lang.Object
    Describe the MIME content type of a resource.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String mediaType  
      private java.util.Map<java.lang.String,​java.lang.String> parameters  
      private java.lang.String subType  
    • Constructor Summary

      Constructors 
      Constructor Description
      ContentType​(java.lang.String mediaType, java.lang.String subType, java.util.Map<java.lang.String,​java.lang.String> parameters)
      Constructs content types, performing an necessary conversions.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getMediaType()
      Gets the media type, normalised to lower case.
      java.util.Map<java.lang.String,​java.lang.String> getParameters()
      Gets an immutable map containing all content type parameters with keys normalised to lower case.
      java.lang.String getSubType()
      Gets the media sub type normalised to lower case
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • mediaType

        private final java.lang.String mediaType
      • subType

        private final java.lang.String subType
      • parameters

        private final java.util.Map<java.lang.String,​java.lang.String> parameters
    • Constructor Detail

      • ContentType

        public ContentType​(java.lang.String mediaType,
                           java.lang.String subType,
                           java.util.Map<java.lang.String,​java.lang.String> parameters)
        Constructs content types, performing an necessary conversions.
        Parameters:
        mediaType - not null
        subType - not null
        parameters - not null
    • Method Detail

      • getMediaType

        public java.lang.String getMediaType()
        Gets the media type, normalised to lower case.
        Returns:
        media type, not null
      • getSubType

        public java.lang.String getSubType()
        Gets the media sub type normalised to lower case
        Returns:
        sub type, not null
      • getParameters

        public java.util.Map<java.lang.String,​java.lang.String> getParameters()
        Gets an immutable map containing all content type parameters with keys normalised to lower case.
        Returns:
        not null