InputStream entityStream) throws IOException,
WebApplicationException {
try {
DocumentBuilder dbuilder = documentBuilderFactory.newDocumentBuilder();
RuntimeContext runtimeContext = RuntimeContextTLS.getRuntimeContext();
WinkConfiguration winkConfig = runtimeContext.getAttribute(WinkConfiguration.class);
if (winkConfig != null) {
Properties props = winkConfig.getProperties();
if (props != null) {
// use valueOf method to require the word "true"
if (!Boolean.valueOf(props.getProperty("wink.supportDTDEntityExpansion"))) {
setupDocumentBuilderToFilterDTD(dbuilder);
}