Search in sources :

Example 1 with DefinitionSupplier

use of io.vertigo.core.definition.DefinitionSupplier in project vertigo by KleeGroup.

the class XmlSecurityLoader method doLoadXML.

private static List<DefinitionSupplier> doLoadXML(final URL configURL) throws SAXException, IOException, ParserConfigurationException {
    xsdValidate(configURL);
    // ---
    final XmlSecurityHandler handler = new XmlSecurityHandler();
    final SAXParserFactory factory = SAXParserFactory.newInstance();
    factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
    final SAXParser saxParser = factory.newSAXParser();
    saxParser.parse(new BufferedInputStream(configURL.openStream()), handler);
    return new ListBuilder<DefinitionSupplier>().addAll(handler.getPermissionSuppliers()).addAll(handler.getRoleSuppliers()).build();
}
Also used : DefinitionSupplier(io.vertigo.core.definition.DefinitionSupplier) BufferedInputStream(java.io.BufferedInputStream) SAXParser(javax.xml.parsers.SAXParser) SAXParserFactory(javax.xml.parsers.SAXParserFactory)

Aggregations

DefinitionSupplier (io.vertigo.core.definition.DefinitionSupplier)1 BufferedInputStream (java.io.BufferedInputStream)1 SAXParser (javax.xml.parsers.SAXParser)1 SAXParserFactory (javax.xml.parsers.SAXParserFactory)1