- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.opensaml.xml.XMLConfigurator.load()
方法的一些代码示例,展示了XMLConfigurator.load()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLConfigurator.load()
方法的具体详情如下:
包路径:org.opensaml.xml.XMLConfigurator
类名称:XMLConfigurator
方法名:load
[英]Loads the configuration file(s) from the given file. If the file is a directory each file within the directory is loaded.
[中]从给定文件加载配置文件。如果文件是目录,则加载目录中的每个文件。
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.wss4j
protected static void initializeXMLTooling(String[] providerConfigs) throws ConfigurationException {
XMLConfigurator configurator = new XMLConfigurator();
for (String config : providerConfigs) {
//most are found in the Configuration.class classloader
InputStream ins = Configuration.class.getResourceAsStream(config);
if (ins == null) {
//some are from us
ins = OpenSAMLBootstrap.class.getResourceAsStream(config);
}
configurator.load(ins);
}
}
代码示例来源:origin: org.apache.ws.security/wss4j
protected static void initializeXMLTooling(String[] providerConfigs) throws ConfigurationException {
XMLConfigurator configurator = new XMLConfigurator();
for (String config : providerConfigs) {
//most are found in the Configuration.class classloader
InputStream ins = Configuration.class.getResourceAsStream(config);
if (ins == null) {
//some are from us
ins = OpenSAMLBootstrap.class.getResourceAsStream(config);
}
configurator.load(ins);
}
}
代码示例来源:origin: io.apigee.opensaml/xmltooling
/**
* Loads the configuration file(s) from the given file. If the file is a directory each file within the directory is
* loaded.
*
* @param configurationFile the configuration file(s) to be loaded
*
* @throws ConfigurationException thrown if the configuration file(s) can not be be read or invalid
*/
public void load(File configurationFile) throws ConfigurationException {
if (configurationFile == null || !configurationFile.canRead()) {
log.error("Unable to read configuration file {}", configurationFile);
}
try {
if (configurationFile.isDirectory()) {
File[] configurations = configurationFile.listFiles();
for (int i = 0; i < configurations.length; i++) {
log.debug("Parsing configuration file {}", configurations[i].getAbsolutePath());
load(new FileInputStream(configurations[i]));
}
} else {
// Given file is not a directory so try to load it directly
log.debug("Parsing configuration file {}", configurationFile.getAbsolutePath());
load(new FileInputStream(configurationFile));
}
} catch (FileNotFoundException e) {
// ignore, we already have the files
}
}
代码示例来源:origin: org.opensaml/xmltooling
/**
* Loads the configuration docuement.
*
* @param configuration the configurationd document
* @throws ConfigurationException thrown if the configuration file(s) can not be be read or invalid
*/
public void load(Document configuration) throws ConfigurationException {
log.debug("Loading configuration from XML Document");
log.trace("{}", XMLHelper.nodeToString(configuration.getDocumentElement()));
// Schema validation
log.debug("Schema validating configuration Document");
validateConfiguration(configuration);
log.debug("Configuration document validated");
load(configuration.getDocumentElement());
}
代码示例来源:origin: io.apigee.opensaml/xmltooling
/**
* Loads the configuration docuement.
*
* @param configuration the configurationd document
* @throws ConfigurationException thrown if the configuration file(s) can not be be read or invalid
*/
public void load(Document configuration) throws ConfigurationException {
log.debug("Loading configuration from XML Document");
log.trace("{}", XMLHelper.nodeToString(configuration.getDocumentElement()));
// Schema validation
log.debug("Schema validating configuration Document");
validateConfiguration(configuration);
log.debug("Configuration document validated");
load(configuration.getDocumentElement());
}
代码示例来源:origin: org.opensaml/xmltooling
/**
* Loads the configuration file(s) from the given file. If the file is a directory each file within the directory is
* loaded.
*
* @param configurationFile the configuration file(s) to be loaded
*
* @throws ConfigurationException thrown if the configuration file(s) can not be be read or invalid
*/
public void load(File configurationFile) throws ConfigurationException {
if (configurationFile == null || !configurationFile.canRead()) {
log.error("Unable to read configuration file {}", configurationFile);
}
try {
if (configurationFile.isDirectory()) {
File[] configurations = configurationFile.listFiles();
for (int i = 0; i < configurations.length; i++) {
log.debug("Parsing configuration file {}", configurations[i].getAbsolutePath());
load(new FileInputStream(configurations[i]));
}
} else {
// Given file is not a directory so try to load it directly
log.debug("Parsing configuration file {}", configurationFile.getAbsolutePath());
load(new FileInputStream(configurationFile));
}
} catch (FileNotFoundException e) {
// ignore, we already have the files
}
}
代码示例来源:origin: org.opensaml/opensaml
/**
* Initializes the XMLTooling library with an explicitly supplied set of object providers.
*
* @param providerConfigs list of provider configuration files located on the classpath
*
* @throws ConfigurationException thrown if there is a problem loading the configuration files
*/
protected static void initializeXMLTooling(String[] providerConfigs) throws ConfigurationException {
Logger log = getLogger();
Class clazz = Configuration.class;
XMLConfigurator configurator = new XMLConfigurator();
for (String config : providerConfigs) {
log.debug("Loading XMLTooling configuration {}", config);
configurator.load(clazz.getResourceAsStream(config));
}
}
代码示例来源:origin: org.opensaml/xmltooling
/**
* Loads a configuration file from an input stream.
*
* @param configurationStream configuration stream
*
* @throws ConfigurationException thrown if the given configuration is invalid or can not be read
*/
public void load(InputStream configurationStream) throws ConfigurationException {
try {
Document configuration = parserPool.parse(configurationStream);
load(configuration);
} catch (XMLParserException e) {
log.error("Invalid configuration file", e);
throw new ConfigurationException("Unable to create DocumentBuilder", e);
}
}
代码示例来源:origin: io.apigee.opensaml/xmltooling
/**
* Loads a configuration file from an input stream.
*
* @param configurationStream configuration stream
*
* @throws ConfigurationException thrown if the given configuration is invalid or can not be read
*/
public void load(InputStream configurationStream) throws ConfigurationException {
try {
Document configuration = parserPool.parse(configurationStream);
load(configuration);
} catch (XMLParserException e) {
log.error("Invalid configuration file", e);
throw new ConfigurationException("Unable to create DocumentBuilder", e);
}
}
代码示例来源:origin: edu.internet2.middleware/shibboleth-common
/** {@inheritDoc} */
public void afterPropertiesSet() throws Exception {
DefaultBootstrap.bootstrap();
if(configResources != null && !configResources.isEmpty()){
XMLConfigurator configurator = new XMLConfigurator();
for(Resource config : configResources){
try{
log.debug("Loading OpenSAML configuration file: {}", config.getLocation());
configurator.load(config.getInputStream());
}catch(Exception e){
log.error("Unable to load OpenSAML configuration file: " + config.getLocation());
}
}
}
if (getParserPool() != null) {
Configuration.setParserPool(getParserPool());
}
}
}
我有一个使用 XMLConfiguration 加载的配置文件(XML)。 我需要确保更新此 XMLConfiguration 实例(每 30 秒)。 为此,我有以下代码: XMLConfigura
我正在创建一个控制台应用程序 (exe) 并尝试使用 log4net 记录错误。如果我在 main 方法中给出以下任何命令,记录器工作正常: XmlConfigurator.Configure(new
我使用 Apache Commons XMLConfiguration 进行配置。现在我需要一个基于模式的验证。但是我在将 xsd 添加到 XMLConfiguration 时遇到问题。 xsd 位于
我正在尝试实例化 XMLConfiguration从 spring appcontext 中,我的配置文件位于 src/main/resources/ 但是当我尝试像这样传递构造函数参数时: 或
如何检查是否有调用log4net的XmlConfigurator.Configure成功了吗?如果无法正确加载日志记录配置(即文件不存在、文件格式不正确等),我想进行 Web 服务调用 最佳答案 来自
我正在使用 org.apache.commons.configuration.XMLConfiguration 来读取 Java 代码中的 XML 配置文件。我的 XML 具有以下格式:
我有一个类似这样的 XML 配置文件: MainServer 192.168.0.5 1
我正在使用 Apache Commons 配置。如何将一个属性(带空格的字符串)添加到我只获得一个属性的配置中? config.addProperty("date", "08.05.2011, 15:
本文整理了Java中org.mortbay.xml.XmlConfiguration.()方法的一些代码示例,展示了XmlConfiguration.()的具体用法。这些代码示例主要来源于Github
本文整理了Java中org.mortbay.xml.XmlConfiguration.configure()方法的一些代码示例,展示了XmlConfiguration.configure()的具体用法
本文整理了Java中org.opensaml.xml.XMLConfigurator.initializeValidatorSuites()方法的一些代码示例,展示了XMLConfigurator.i
本文整理了Java中org.opensaml.xml.XMLConfigurator.load()方法的一些代码示例,展示了XMLConfigurator.load()的具体用法。这些代码示例主要来源
本文整理了Java中org.opensaml.xml.XMLConfigurator.initializeIDAttributes()方法的一些代码示例,展示了XMLConfigurator.init
本文整理了Java中org.opensaml.xml.XMLConfigurator.createClassInstance()方法的一些代码示例,展示了XMLConfigurator.createC
本文整理了Java中org.opensaml.xml.XMLConfigurator.validateConfiguration()方法的一些代码示例,展示了XMLConfigurator.valid
本文整理了Java中org.opensaml.xml.XMLConfigurator.()方法的一些代码示例,展示了XMLConfigurator.()的具体用法。这些代码示例主要来源于Github/
我有点困惑如何编辑 xml 内容,例如我有一个 xml 文件 abc def pqr xyz 如何将“xyz”编辑为“stu” 我尝试使用 common
我有这个 XML log4net 配置: 我用下面的 C# 行加载了这个配置,它运行良好: log4n
我明白 this question has been asked several times ,但不幸的是,我无法使我的日志记录配置正常工作。我一定是在某个地方犯了一些非常小的错误。 我有一个 .NE
我有带有 log4net 配置的自定义 xml 文件。下面的代码用于配置 log4net。它工作正常。 问题是 LogManager.Getlogger 在不知道配置文件详细信息时如何获取“MyLog
我是一名优秀的程序员,十分优秀!