public final class XmlContentResponseDetector extends java.lang.Object implements ITextBasedResponseDetector
Constructor and Description |
---|
XmlContentResponseDetector(java.lang.String... contentTypes)
Creates a new detector with the specified array of content types to look for.
|
Modifier and Type | Method and Description |
---|---|
java.nio.charset.Charset |
performDetection(IReceiveEvent event)
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 nullpublic java.nio.charset.Charset performDetection(IReceiveEvent event) throws java.io.IOException
ITextBasedResponseDetector
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.
performDetection
in interface ITextBasedResponseDetector
event
- the receive event (containing all information except for the reader), must be non-nulljava.io.IOException
- in case of any errors during detection (typically resulting from sniffing into the response stream)