use of org.apache.felix.utils.properties.Properties in project karaf by apache.
the class Activator method doOpen.
@Override
protected void doOpen() throws Exception {
super.doOpen();
Properties configuration = new Properties();
File configFile = new File(System.getProperty("karaf.etc"), FEATURES_SERVICE_CONFIG_FILE);
if (configFile.isFile() && configFile.canRead()) {
try {
configuration.load(new FileReader(configFile));
} catch (IOException e) {
logger.warn("Error reading configuration file " + configFile.toString(), e);
}
}
Dictionary<String, String> props = new Hashtable<>();
for (Map.Entry<String, String> entry : configuration.entrySet()) {
props.put(entry.getKey(), entry.getValue());
}
updated(props);
}
use of org.apache.felix.utils.properties.Properties in project karaf by apache.
the class CreateCommand method doExecute.
protected Object doExecute() throws Exception {
if (!bare) {
Properties configuration = new Properties();
File configFile = new File(System.getProperty("karaf.etc"), FEATURES_SERVICE_CONFIG_FILE);
configuration.load(configFile);
String featuresRepositories = configuration.getProperty("featuresRepositories", "");
String featuresBoot = configuration.getProperty("featuresBoot", "");
if (featureURLs == null) {
featureURLs = new ArrayList<>();
}
for (String repo : featuresRepositories.split(",")) {
repo = repo.trim();
if (!repo.isEmpty()) {
featureURLs.add(repo);
}
}
if (features == null) {
features = new ArrayList<>();
}
for (String feature : featuresBoot.split(",")) {
feature = feature.trim();
if (!feature.isEmpty()) {
features.add(feature);
}
}
}
Map<String, URL> textResources = getResources(textResourceLocation);
Map<String, URL> binaryResources = getResources(binaryResourceLocations);
InstanceSettings settings = new InstanceSettings(sshPort, rmiRegistryPort, rmiServerPort, location, javaOpts, featureURLs, features, address, textResources, binaryResources, profiles);
getInstanceService().createInstance(instance, settings, verbose);
return null;
}
use of org.apache.felix.utils.properties.Properties in project karaf by apache.
the class GSSAPILdapLoginModuleTest method ldapLoginModuleOptions.
protected Properties ldapLoginModuleOptions() throws IOException {
String basedir = System.getProperty("basedir");
if (basedir == null) {
basedir = new File(".").getCanonicalPath();
}
File file = new File(basedir + "/target/test-classes/org/apache/karaf/jaas/modules/ldap/gssapi.ldap.properties");
return new Properties(file);
}
use of org.apache.felix.utils.properties.Properties in project karaf by apache.
the class LdapCacheTest method ldapLoginModuleOptions.
protected Properties ldapLoginModuleOptions() throws IOException {
String basedir = System.getProperty("basedir");
if (basedir == null) {
basedir = new File(".").getCanonicalPath();
}
File file = new File(basedir + "/target/test-classes/org/apache/karaf/jaas/modules/ldap/ldap.properties");
return new Properties(file);
}
use of org.apache.felix.utils.properties.Properties in project karaf by apache.
the class LdapCaseInsensitiveDNTest method ldapLoginModuleOptions.
protected Properties ldapLoginModuleOptions() throws IOException {
String basedir = System.getProperty("basedir");
if (basedir == null) {
basedir = new File(".").getCanonicalPath();
}
File file = new File(basedir + "/target/test-classes/org/apache/karaf/jaas/modules/ldap/ldapCaseInsensitiveDN.properties");
return new Properties(file);
}
Aggregations