Package com.adaptris.core.http
Class ConfiguredContentTypeProvider
- java.lang.Object
-
- com.adaptris.core.http.ContentTypeProviderImpl
-
- com.adaptris.core.http.ConfiguredContentTypeProvider
-
- All Implemented Interfaces:
ContentTypeProvider
public class ConfiguredContentTypeProvider extends ContentTypeProviderImpl
Provides a static content type.Note that the content type character set will be derived from
AdaptrisMessage.getCharEncoding()so configuring a mime type oftext/xmlwhen the message has a char encoding ofUTF-8will returntext/xml; charset=UTF-8In the adapter configuration file this class is aliased as http-configured-content-type-provider which is the preferred alternative to the fully qualified classname when building your configuration.
-
-
Constructor Summary
Constructors Constructor Description ConfiguredContentTypeProvider()ConfiguredContentTypeProvider(java.lang.String type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetContentType(AdaptrisMessage msg)Get the content type.java.lang.StringgetMimeType()voidsetMimeType(java.lang.String type)Set the base content type.-
Methods inherited from class com.adaptris.core.http.ContentTypeProviderImpl
build
-
-
-
-
Method Detail
-
getContentType
public java.lang.String getContentType(AdaptrisMessage msg) throws CoreException
Description copied from interface:ContentTypeProviderGet the content type.- Parameters:
msg- the Adaptris Message- Returns:
- the content type.
- Throws:
CoreException- wrapping other exceptions
-
getMimeType
public java.lang.String getMimeType()
-
setMimeType
public void setMimeType(java.lang.String type)
Set the base content type.- Parameters:
type- the base content type; defaults to text/plain
-
-