if (uri == null) {
URL resource = ClassLoaderUtils.getResource("security-config.xml", Init.class);
if (resource == null) {
//kind of chicken-egg problem here
I18n.init("en", "US");
throw new XMLSecurityConfigurationException("empty", "security-config.xml not found in classpath");
}
uri = resource.toURI();
}
saxParser.parse(uri.toURL().toExternalForm(), new XIncludeHandler(unmarshallerHandler));
JAXBElement<ConfigurationType> configurationTypeJAXBElement = (JAXBElement<ConfigurationType>) unmarshallerHandler.getResult();
ConfigurationProperties.init(configurationTypeJAXBElement.getValue().getProperties(), callingClass);
SecurityHeaderHandlerMapper.init(configurationTypeJAXBElement.getValue().getSecurityHeaderHandlers(), callingClass);
JCEAlgorithmMapper.init(configurationTypeJAXBElement.getValue().getJCEAlgorithmMappings());
TransformerAlgorithmMapper.init(configurationTypeJAXBElement.getValue().getTransformAlgorithms(), callingClass);
ResourceResolverMapper.init(configurationTypeJAXBElement.getValue().getResourceResolvers(), callingClass);
I18n.init(ConfigurationProperties.getProperty("DefaultLanguageCode"), ConfigurationProperties.getProperty("DefaultCountryCode"));
} catch (Exception e) {
//kind of chicken-egg problem here
I18n.init("en", "US");
throw new XMLSecurityConfigurationException(e);
}
initialized = uri;
}
}