public final class XmlContentResponseDetector extends java.lang.Object implements ITextBasedResponseDetector
|Constructor and Description|
Creates a new detector with the specified array of content types to look for.
|Modifier and Type||Method and Description|
Performs the detection of the charset of the response described by the event.
public XmlContentResponseDetector(java.lang.String... contentTypes)
Passing null or an empty array makes this detector effectively unnecessary as it will not recognize anything.
contentTypes- the array of content types to treat as XML, can be null
public java.nio.charset.Charset performDetection(IReceiveEvent event) throws java.io.IOException
IReceiveEvent.getReader()method is guaranteed to return null.
Just like for response filters, the conversation flow allows this method to sniff into the input stream which will be rewound after the invocation of this method.
event- the receive event (containing all information except for the reader), must be non-null
java.io.IOException- in case of any errors during detection (typically resulting from sniffing into the response stream)