use of org.apache.cxf.staxutils.DepthRestrictingStreamReader in project cxf by apache.
the class DepthRestrictingStreamInterceptor method handleMessage.
public void handleMessage(Message message) {
if (canBeIgnored(message)) {
return;
}
XMLStreamReader reader = message.getContent(XMLStreamReader.class);
if (reader == null) {
InputStream is = message.getContent(InputStream.class);
if (is != null) {
reader = StaxUtils.createXMLStreamReader(is);
message.setContent(InputStream.class, null);
}
if (reader == null) {
return;
}
}
DepthRestrictingStreamReader dr = new DepthRestrictingStreamReader(reader, elementCountThreshold, innerElementLevelThreshold, innerElementCountThreshold);
message.setContent(XMLStreamReader.class, dr);
}
use of org.apache.cxf.staxutils.DepthRestrictingStreamReader in project cxf by apache.
the class AbstractJAXBProvider method createDepthReaderIfNeeded.
protected XMLStreamReader createDepthReaderIfNeeded(XMLStreamReader reader, InputStream is) {
DocumentDepthProperties props = getDepthProperties();
if (props != null && props.isEffective()) {
reader = TransformUtils.createNewReaderIfNeeded(reader, is);
reader = new DepthRestrictingStreamReader(reader, props);
} else if (reader != null) {
reader = configureReaderRestrictions(reader);
}
return reader;
}
use of org.apache.cxf.staxutils.DepthRestrictingStreamReader in project tomee by apache.
the class AbstractJAXBProvider method createDepthReaderIfNeeded.
protected XMLStreamReader createDepthReaderIfNeeded(XMLStreamReader reader, InputStream is) {
DocumentDepthProperties props = getDepthProperties();
if (props != null && props.isEffective()) {
reader = TransformUtils.createNewReaderIfNeeded(reader, is);
reader = new DepthRestrictingStreamReader(reader, props);
} else if (reader != null) {
reader = configureReaderRestrictions(reader);
}
return reader;
}
Aggregations