Package fr.gouv.vitam.common.xml
Class SecureXMLFactoryUtils
java.lang.Object
fr.gouv.vitam.common.xml.SecureXMLFactoryUtils
Helper for secure xml factory initialization.
See Java API for XML Processing (JAXP) Security Guide
See OWASP XML External Entity Prevention Cheat Sheet
See XML External entity prevention for Java
-
Method Summary
Modifier and TypeMethodDescriptionstatic DocumentBuilderFactory
static SAXParserFactory
static XMLEventReader
createSecureXMLEventReader
(InputStream inputStream) static XMLStreamReader
createSecureXMLStreamReader
(InputStream inputStream) static XMLStreamReader
createSecureXMLStreamReader
(Reader reader) static void
validateXmlFile
(File xmlFile) static void
xsltTransform
(InputStream xsltInputStream, InputStream xmlInputStream, OutputStream xmlOutputStream)
-
Method Details
-
createSecureXMLEventReader
public static XMLEventReader createSecureXMLEventReader(InputStream inputStream) throws XMLStreamException - Throws:
XMLStreamException
-
createSecureXMLStreamReader
public static XMLStreamReader createSecureXMLStreamReader(InputStream inputStream) throws XMLStreamException - Throws:
XMLStreamException
-
createSecureXMLStreamReader
- Throws:
XMLStreamException
-
createSecureDocumentBuilderFactory
-
createSecureSAXParserFactory
-
validateXmlFile
- Throws:
SAXException
-
xsltTransform
public static void xsltTransform(InputStream xsltInputStream, InputStream xmlInputStream, OutputStream xmlOutputStream) throws TransformerException - Throws:
TransformerException
-