作者:佩菱淑华7 | 来源:互联网 | 2023-08-19 20:40
本文整理了Java中org.apache.commons.configuration.HierarchicalConfiguration.getStringArray()
本文整理了Java中org.apache.commons.configuration.HierarchicalConfiguration.getStringArray()
方法的一些代码示例,展示了HierarchicalConfiguration.getStringArray()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HierarchicalConfiguration.getStringArray()
方法的具体详情如下:
包路径:org.apache.commons.configuration.HierarchicalConfiguration
类名称:HierarchicalConfiguration
方法名:getStringArray
HierarchicalConfiguration.getStringArray介绍
暂无
代码示例
代码示例来源:origin: stoicflame/enunciate
protected String[] getSchemes() {
return this.config.getStringArray("scheme");
}
代码示例来源:origin: org.zaproxy/zap
protected List getStrings(HierarchicalConfiguration zapAddOnXml, String element, String elementName) {
String[] fields = zapAddOnXml.getStringArray(element);
if (fields.length == 0) {
return Collections.emptyList();
}
ArrayList strings = new ArrayList<>(fields.length);
for (String field : fields) {
if (!field.isEmpty()) {
strings.add(field);
} else {
LOGGER.warn("Ignoring empty \"" + elementName + "\" entry in add-on \"" + name + "\".");
}
}
if (strings.isEmpty()) {
return Collections.emptyList();
}
strings.trimToSize();
return strings;
}
代码示例来源:origin: org.apache.james/james-server-protocols-smtp
@Override
public void init(Configuration config) throws ConfigurationException {
boolean validCOnfig= false;
HierarchicalConfiguration handlerCOnfiguration= (HierarchicalConfiguration) config;
ArrayList rblserverCollection = new ArrayList<>();
Collections.addAll(rblserverCollection, handlerConfiguration.getStringArray("rblservers.whitelist"));
if (rblserverCollection.size() > 0) {
setWhitelist(rblserverCollection.toArray(new String[rblserverCollection.size()]));
rblserverCollection.clear();
validCOnfig= true;
}
Collections.addAll(rblserverCollection, handlerConfiguration.getStringArray("rblservers.blacklist"));
if (rblserverCollection.size() > 0) {
setBlacklist(rblserverCollection.toArray(new String[rblserverCollection.size()]));
rblserverCollection.clear();
validCOnfig= true;
}
// Throw an ConfiigurationException on invalid config
if (!validConfig) {
throw new ConfigurationException("Please configure whitelist or blacklist");
}
setGetDetail(handlerConfiguration.getBoolean("getDetail", false));
}
代码示例来源:origin: org.apache.james/james-server-smtpserver
public void configure(HierarchicalConfiguration config) throws ConfigurationException {
String[] servers = config.getStringArray("uriRblServers.server");
Collection serverCollection = new ArrayList();
for ( int i = 0 ; i String rblServerName = servers[i];
serverCollection.add(rblServerName);
if (serviceLog.isInfoEnabled()) {
serviceLog.info("Adding uriRBL server: " + rblServerName);
}
}
if (serverCollection != null && serverCollection.size() > 0) {
setUriRblServer(serverCollection);
} else {
throw new ConfigurationException("Please provide at least one server");
}
setGetDetail(config.getBoolean("getDetail",false));
}
代码示例来源:origin: oVirt/ovirt-engine
private void populateAlternateKeyMap(HierarchicalConfiguration config) {
List cOnfigurationsAt= config.configurationsAt("/*/" + ALTERNATE_KEY);
alternateKeysMap = new HashMap<>(configurationsAt.size());
for (SubnodeConfiguration node : configurationsAt) {
String rootKey = node.getRootNode()
.getParentNode().getName();
String[] alternateKeys = config.getStringArray("/" + rootKey + "/" + ALTERNATE_KEY);
for (String token : alternateKeys) {
alternateKeysMap.put(token, rootKey);
}
}
}
代码示例来源:origin: org.apache.james/james-server-data-memory
private void readConfigurationEntry(HierarchicalConfiguration repositoryConfiguration) throws ConfigurationException {
String className = repositoryConfiguration.getString("[@class]");
MailRepositoryProvider usedMailRepository = mailRepositories.stream()
.filter(mailRepositoryProvider -> mailRepositoryProvider.canonicalName().equals(className))
.findAny()
.orElseThrow(() -> new ConfigurationException("MailRepository " + className + " has not been registered"));
for (String protocol : repositoryConfiguration.getStringArray("protocols.protocol")) {
protocolToRepositoryProvider.put(new Protocol(protocol), usedMailRepository);
registerRepositoryDefaultConfiguration(repositoryConfiguration, new Protocol(protocol));
}
}
代码示例来源:origin: org.apache.james/james-server-data-library
public static DomainListConfiguration from(HierarchicalConfiguration config) {
ImmutableList cOnfiguredDomains= StreamUtils.ofNullable(config.getStringArray(CONFIGURE_DOMAIN_NAMES))
.filter(s -> !s.isEmpty())
.map(Domain::of)
.collect(Guavate.toImmutableList());
return builder()
.autoDetect(Optional.ofNullable(config.getBoolean(CONFIGURE_AUTODETECT, null)))
.autoDetectIp(Optional.ofNullable(config.getBoolean(CONFIGURE_AUTODETECT_IP, null)))
.defaultDomain(Optional.ofNullable(config.getString(CONFIGURE_DEFAULT_DOMAIN, null))
.map(Domain::of))
.addConfiguredDomains(configuredDomains)
.build();
}
代码示例来源:origin: apache/james-project
Collections.addAll(dnsServers, configuration.getStringArray("servers.server"));
for (String aSearchPathsConfiguration : configuration.getStringArray("searchpaths.searchpath")) {
try {
sPaths.add(Name.fromString(aSearchPathsConfiguration));
代码示例来源:origin: org.apache.james/james-server-dnsservice-dnsjava
Collections.addAll(dnsServers, configuration.getStringArray("servers.server"));
for (String aSearchPathsConfiguration : configuration.getStringArray("searchpaths.searchpath")) {
try {
sPaths.add(Name.fromString(aSearchPathsConfiguration));
代码示例来源:origin: org.zaproxy/zap
for (String savedExtension : savedAddOn.getStringArray(ADDON_RUNNABLE_ALL_EXTENSIONS_KEY)) {
if (currentExtensions.contains(savedExtension)) {
runnableExtensions.add(savedExtension);
代码示例来源:origin: apache/james-project
enabledCipherSuites = config.getStringArray("tls.supportedCipherSuites.cipherSuite");
keystore = config.getString("tls.keystore", null);
if (keystore == null) {