use of org.apache.commons.configuration.FileConfiguration in project grakn by graknlabs.
the class GraknSparkComputer method main.
public static void main(final String[] args) throws Exception {
final FileConfiguration configuration = new PropertiesConfiguration(args[0]);
new GraknSparkComputer(HadoopGraph.open(configuration)).program(VertexProgram.createVertexProgram(HadoopGraph.open(configuration), configuration)).submit().get();
}
use of org.apache.commons.configuration.FileConfiguration in project bookkeeper by apache.
the class ConfigurationSubscription method initConfig.
private boolean initConfig() {
if (fileConfigs.isEmpty()) {
try {
for (FileConfigurationBuilder fileConfigBuilder : fileConfigBuilders) {
FileConfiguration fileConfig = fileConfigBuilder.getConfiguration();
FileChangedReloadingStrategy reloadingStrategy = new FileChangedReloadingStrategy();
reloadingStrategy.setRefreshDelay(0);
fileConfig.setReloadingStrategy(reloadingStrategy);
fileConfigs.add(fileConfig);
}
} catch (ConfigurationException ex) {
if (!fileNotFound(ex)) {
LOG.error("Config init failed {}", ex);
}
}
}
return !fileConfigs.isEmpty();
}
use of org.apache.commons.configuration.FileConfiguration in project zaproxy by zaproxy.
the class ExtensionPassiveScan method addPluginPassiveScannerImpl.
private boolean addPluginPassiveScannerImpl(PluginPassiveScanner scanner) {
if (scanner instanceof RegexAutoTagScanner) {
return false;
}
boolean added = false;
try {
FileConfiguration config = this.getModel().getOptionsParam().getConfig();
scanner.setConfig(config);
added = addPassiveScannerImpl(scanner);
if (hasView()) {
getPolicyPanel().getPassiveScanTableModel().addScanner(scanner);
}
logger.info("loaded passive scan rule: {}", scanner.getName());
if (scanner.getPluginId() == -1) {
logger.error("The passive scan rule \"{}\" [{}] does not have a defined ID.", scanner.getName(), scanner.getClass().getCanonicalName());
}
} catch (Exception e) {
logger.error("Failed to load passive scan rule {}", scanner.getName(), e);
}
return added;
}
use of org.apache.commons.configuration.FileConfiguration in project zaproxy by zaproxy.
the class OptionsParamApiUnitTest method shouldParseLoadedFileConfiguration.
@Test
void shouldParseLoadedFileConfiguration() {
// Given
OptionsParamApi param = new OptionsParamApi();
FileConfiguration config = createTestConfig();
// When
param.load(config);
// Then
assertThat(param.isEnabled(), is(equalTo(false)));
assertThat(param.isSecureOnly(), is(equalTo(true)));
assertThat(param.isDisableKey(), is(equalTo(true)));
assertThat(param.isIncErrorDetails(), is(equalTo(true)));
assertThat(param.isAutofillKey(), is(equalTo(true)));
assertThat(param.isEnableJSONP(), is(equalTo(true)));
assertThat(param.getRealKey(), is(equalTo("ApiKey")));
}
use of org.apache.commons.configuration.FileConfiguration in project zaproxy by zaproxy.
the class OptionsParamApiUnitTest method shouldHaveLoadedConfigsAfterCloning.
@Test
void shouldHaveLoadedConfigsAfterCloning() {
// Given
OptionsParamApi param = new OptionsParamApi();
FileConfiguration config = createTestConfig();
param.load(config);
// When
OptionsParamApi clone = param.clone();
// Then
assertThat(clone, is(notNullValue()));
assertThat(param.isEnabled(), is(equalTo(false)));
assertThat(param.isSecureOnly(), is(equalTo(true)));
assertThat(param.isDisableKey(), is(equalTo(true)));
assertThat(param.isIncErrorDetails(), is(equalTo(true)));
assertThat(param.isAutofillKey(), is(equalTo(true)));
assertThat(param.isEnableJSONP(), is(equalTo(true)));
assertThat(param.getRealKey(), is(equalTo("ApiKey")));
}
Aggregations