Class MetadataContentTypeProvider

  • All Implemented Interfaces:
    ContentTypeProvider

    public class MetadataContentTypeProvider
    extends ContentTypeProviderImpl
    Provides a content type derived from metadata.

    Note that the content type charset will be derived from AdaptrisMessage.getCharEncoding() so configuring a mime type of text/xml when the message has a char encoding of UTF-8 will return text/xml; charset="UTF-8". No validation is done on the resulting string or on the value that is taken from metadata.

    In the adapter configuration file this class is aliased as http-metadata-content-type-provider which is the preferred alternative to the fully qualified classname when building your configuration.

    • Constructor Detail

      • MetadataContentTypeProvider

        public MetadataContentTypeProvider()
      • MetadataContentTypeProvider

        public MetadataContentTypeProvider​(java.lang.String key)
    • Method Detail

      • getMetadataKey

        public java.lang.String getMetadataKey()
      • setMetadataKey

        public void setMetadataKey​(java.lang.String key)
        Set the metadata item containing content type.
        Parameters:
        key - the key containing the base content type
      • getDefaultMimeType

        public java.lang.String getDefaultMimeType()
      • setDefaultMimeType

        public void setDefaultMimeType​(java.lang.String mt)
        Set the default mime type to use if the metadata key does not exist.
        Parameters:
        mt - the mime type; defaults to text/plain