Repository: ambari Updated Branches: refs/heads/trunk 904370a60 -> 43f02f903
AMBARI-20635. Implement XML processing best practices in Hive View. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/43f02f90 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/43f02f90 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/43f02f90 Branch: refs/heads/trunk Commit: 43f02f903202761c0ba8b226e7fe7ca89dcd96bf Parents: 904370a Author: Dipayan Bhowmick <[email protected]> Authored: Thu Mar 30 22:02:31 2017 +0530 Committer: Dipayan Bhowmick <[email protected]> Committed: Thu Mar 30 22:03:14 2017 +0530 ---------------------------------------------------------------------- .../ambari/view/hive2/resources/uploads/parsers/xml/XMLParser.java | 2 ++ .../view/hive20/resources/uploads/parsers/xml/XMLParser.java | 2 ++ 2 files changed, 4 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/43f02f90/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/uploads/parsers/xml/XMLParser.java ---------------------------------------------------------------------- diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/uploads/parsers/xml/XMLParser.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/uploads/parsers/xml/XMLParser.java index 95e996c..e2be5db 100644 --- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/uploads/parsers/xml/XMLParser.java +++ b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/uploads/parsers/xml/XMLParser.java @@ -63,6 +63,8 @@ public class XMLParser extends Parser { super(reader, parseOptions); XMLInputFactory factory = XMLInputFactory.newInstance(); try { + factory.setProperty(XMLInputFactory.SUPPORT_DTD, false); + factory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false); this.xmlReader = factory.createXMLEventReader(reader); } catch (XMLStreamException e) { LOG.error("error occurred while creating xml reader : ", e); http://git-wip-us.apache.org/repos/asf/ambari/blob/43f02f90/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/parsers/xml/XMLParser.java ---------------------------------------------------------------------- diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/parsers/xml/XMLParser.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/parsers/xml/XMLParser.java index abcf2c0..05ef34f 100644 --- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/parsers/xml/XMLParser.java +++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/parsers/xml/XMLParser.java @@ -63,6 +63,8 @@ public class XMLParser extends Parser { super(reader, parseOptions); XMLInputFactory factory = XMLInputFactory.newInstance(); try { + factory.setProperty(XMLInputFactory.SUPPORT_DTD, false); + factory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false); this.xmlReader = factory.createXMLEventReader(reader); } catch (XMLStreamException e) { LOG.error("error occurred while creating xml reader : ", e);
