Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 85af32f2d -> a43407b9c


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/a43407b9
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a43407b9
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a43407b9

Branch: refs/heads/branch-2.5
Commit: a43407b9c42432bcaf7bd8bb40d8d8c0bca1abb0
Parents: 85af32f
Author: Dipayan Bhowmick <[email protected]>
Authored: Thu Mar 30 22:02:31 2017 +0530
Committer: Dipayan Bhowmick <[email protected]>
Committed: Thu Mar 30 22:02:31 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/a43407b9/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/a43407b9/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);

Reply via email to