X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fnetconf-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fapi%2FNetconfDocumentedException.java;h=e1e932b55a31e709a5618dc23818cc848d07e088;hp=0c365b9d30ebcb5463440404b0c9d10a3a015d5c;hb=8ef160aa623096fc2905bb449997306bbec2b295;hpb=c7ec8db7f107b5e265f4e8b2fe3dd0f7b1163b64 diff --git a/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfDocumentedException.java b/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfDocumentedException.java index 0c365b9d30..e1e932b55a 100644 --- a/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfDocumentedException.java +++ b/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfDocumentedException.java @@ -21,10 +21,8 @@ import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; - import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; - import org.opendaylight.controller.config.api.ConflictingVersionException; import org.opendaylight.controller.config.api.ValidationException; import org.slf4j.Logger; @@ -47,6 +45,15 @@ public class NetconfDocumentedException extends Exception { static { BUILDER_FACTORY = DocumentBuilderFactory.newInstance(); + try { + BUILDER_FACTORY.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); + BUILDER_FACTORY.setFeature("http://xml.org/sax/features/external-general-entities", false); + BUILDER_FACTORY.setFeature("http://xml.org/sax/features/external-parameter-entities", false); + BUILDER_FACTORY.setXIncludeAware(false); + BUILDER_FACTORY.setExpandEntityReferences(false); + } catch (ParserConfigurationException e) { + throw new ExceptionInInitializerError(e); + } BUILDER_FACTORY.setNamespaceAware(true); BUILDER_FACTORY.setCoalescing(true); BUILDER_FACTORY.setIgnoringElementContentWhitespace(true);