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();
}
Aggregations