Package org.forgerock.util.xml
Class XMLUtils
- java.lang.Object
-
- org.forgerock.util.xml.XMLUtils
-
public final class XMLUtils extends Object
Utility classes for handling XML.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DocumentBuilder
getSafeDocumentBuilder(boolean validating)
Provides a secure DocumentBuilder implementation, which is protected against different types of entity expansion attacks and makes sure that only locally available DTDs can be referenced within the XML document.static SAXParser
getSafeSAXParser(boolean validating)
Provides a secure SAXParser instance, which is protected against different types of entity expension, DoS attacks and makes sure that only locally available DTDs can be referenced within the XML document.
-
-
-
Method Detail
-
getSafeDocumentBuilder
public static DocumentBuilder getSafeDocumentBuilder(boolean validating) throws ParserConfigurationException
Provides a secure DocumentBuilder implementation, which is protected against different types of entity expansion attacks and makes sure that only locally available DTDs can be referenced within the XML document.- Parameters:
validating
- Whether the returned DocumentBuilder should validate input.- Returns:
- A secure DocumentBuilder instance.
- Throws:
ParserConfigurationException
- In case xerces does not support one of the required features.
-
getSafeSAXParser
public static SAXParser getSafeSAXParser(boolean validating) throws ParserConfigurationException, SAXException
Provides a secure SAXParser instance, which is protected against different types of entity expension, DoS attacks and makes sure that only locally available DTDs can be referenced within the XML document.- Parameters:
validating
- Whether the returned DocumentBuilder should validate input.- Returns:
- A secure SAXParser instance.
- Throws:
ParserConfigurationException
- In case Xerces does not support one of the required features.SAXException
- In case Xerces does not support one of the required features.
-
-