Class ContentTypeOptions


  • public class ContentTypeOptions
    extends java.lang.Object
    Defines a permitted class of MIME types.
    Since:
    24 May 2016
    Author:
    Mark Taylor
    • Constructor Summary

      Constructors 
      Constructor Description
      ContentTypeOptions​(uk.ac.starlink.util.ContentType[] permittedTypes)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void checkType​(Reporter reporter, java.lang.String declaredTypeTxt, java.net.URL url)
      Checks a declared Content-Type string against the permitted values for this object.
      • Methods inherited from class java.lang.Object

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

      • ContentTypeOptions

        public ContentTypeOptions​(uk.ac.starlink.util.ContentType[] permittedTypes)
        Constructor.
        Parameters:
        permittedTypes - array of MIME type/subtype strings allowed
    • Method Detail

      • checkType

        public void checkType​(Reporter reporter,
                              java.lang.String declaredTypeTxt,
                              java.net.URL url)
        Checks a declared Content-Type string against the permitted values for this object. Validation messages are reported in case of non-compliance.
        Parameters:
        reporter - destination for validation messages
        declaredTypeTxt - Content-Type to assess
        url - source of content, used for report messages