Class XMLUtil
java.lang.Object
com.inductiveautomation.ignition.common.XMLUtil
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
closeElement
(PrintWriter out, String element) Writes </element>static DocumentBuilderFactory
The createSafeDocumentBuilderFactory() method returns a new DocumentBuilderFactory Instance that has been configured to prevent XXE attacks possible through weakly configured XML parsers processing external entities.static SAXParserFactory
The createSafeSAXParserFactory() method returns a new DocumentBuilderFactory Instance that has been configured to prevent XXE attacks possible through weakly configured XML parsers processing external entities.static TransformerFactory
static XMLReader
The createSafeXMLReader() method returns a new XMLReader Instance that has been configured to prevent XXE attacks possible through weakly configured XML parsers processing external entities.static XMLReader
createSafeXMLReader
(String className) The createSafeXMLReader() method returns a new XMLReader Instance that has been configured to prevent XXE attacks possible through weakly configured XML parsers processing external entities.static void
static void
openElement
(PrintWriter out, String element) Writes <element>static void
printXMLHead
(PrintWriter out) static void
printXMLHead
(Writer out) static void
static void
printXMLHead
(Formatter out) static String
static void
setSafetyFeatures
(XMLReader reader) Sets safety features on the provided XMLReader instancestatic void
writeElement
(PrintWriter out, String element, String contents) Writes <element>contents</element> , quoting the contents.
-
Field Details
-
dateFormat
-
-
Constructor Details
-
XMLUtil
public XMLUtil()
-
-
Method Details
-
createSafeDocumentBuilderFactory
The createSafeDocumentBuilderFactory() method returns a new DocumentBuilderFactory Instance that has been configured to prevent XXE attacks possible through weakly configured XML parsers processing external entities.See: https://www.owasp.org/index.php/XML_External_Entity_%28XXE%29_Processing for more info
-
createSafeTransformerFactory
-
createSafeSAXParserFactory
The createSafeSAXParserFactory() method returns a new DocumentBuilderFactory Instance that has been configured to prevent XXE attacks possible through weakly configured XML parsers processing external entities.See: https://www.owasp.org/index.php/XML_External_Entity_%28XXE%29_Processing for more info
-
createSafeXMLReader
The createSafeXMLReader() method returns a new XMLReader Instance that has been configured to prevent XXE attacks possible through weakly configured XML parsers processing external entities.See: https://cheatsheetseries.owasp.org/cheatsheets/XML_External_Entity_Prevention_Cheat_Sheet.html#xmlreader for more info
- Throws:
SAXException
-
createSafeXMLReader
The createSafeXMLReader() method returns a new XMLReader Instance that has been configured to prevent XXE attacks possible through weakly configured XML parsers processing external entities.See: https://cheatsheetseries.owasp.org/cheatsheets/XML_External_Entity_Prevention_Cheat_Sheet.html#xmlreader for more info
Calls
XMLReaderFactory.createXMLReader(String)
and provides the given className- Throws:
SAXException
-
setSafetyFeatures
Sets safety features on the provided XMLReader instanceSee: https://cheatsheetseries.owasp.org/cheatsheets/XML_External_Entity_Prevention_Cheat_Sheet.html#xmlreader for more info
-
printXMLHead
- Throws:
IOException
-
printXMLHead
-
printXMLHead
-
printXMLHead
-
openElement
Writes <element> -
closeElement
Writes </element> -
writeElement
Writes <element>contents</element> , quoting the contents. If contents is null, writes <element/> -
main
-
quoteCharacters
-