private boolean checkCreated(BundleContext bundleContext) throws IOException { org.apache.felix.utils.properties.Properties props = new org.apache.felix.utils.properties.Properties(new File(dataDir, ENSEMBLE_MARKER)); return props.containsKey("created"); }
private boolean checkCreated(BundleContext bundleContext) throws IOException { org.apache.felix.utils.properties.Properties props = new org.apache.felix.utils.properties.Properties(new File(dataDir, ENSEMBLE_MARKER)); return props.containsKey("created"); }
" packages. It can't be empty, please check etc/config.properties of the assembly."); if (configProps.containsKey(Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA)) { exportPackages += "," + configProps.getProperty(Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA);
" packages. It can't be empty, please check etc/config.properties of the assembly."); if (configProps.containsKey(Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA)) { exportPackages += "," + configProps.getProperty(Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA);
if (configProps.containsKey("org.osgi.framework.system.packages.extra")) { exportPackages += "," + configProps.getProperty("org.osgi.framework.system.packages.extra");
if (configProps.containsKey("org.osgi.framework.system.packages.extra")) { exportPackages += "," + configProps.getProperty("org.osgi.framework.system.packages.extra");
public boolean update(Properties properties) { boolean modified = false; // Remove "removed" properties from the cfg file for (String key : new ArrayList<String>(this.keySet())) { if (!properties.containsKey(key)) { this.remove(key); modified = true; } } // Update existing keys for (String key : properties.keySet()) { String v = this.get(key); List<String> comments = properties.getComments(key); List<String> value = properties.getRaw(key); if (v == null) { this.put(key, comments, value); modified = true; } else if (!v.equals(properties.get(key))) { if (comments.isEmpty()) { comments = this.getComments(key); } this.put(key, comments, value); modified = true; } } return modified; }
public boolean update(Properties properties) { boolean modified = false; // Remove "removed" properties from the cfg file for (String key : new ArrayList<String>(this.keySet())) { if (!properties.containsKey(key)) { this.remove(key); modified = true; } } // Update existing keys for (String key : properties.keySet()) { String v = this.get(key); List<String> comments = properties.getComments(key); List<String> value = properties.getRaw(key); if (v == null) { this.put(key, comments, value); modified = true; } else if (!v.equals(properties.get(key))) { if (comments.isEmpty()) { comments = this.getComments(key); } this.put(key, comments, value); modified = true; } } return modified; }
public boolean update(Properties properties) { boolean modified = false; // Remove "removed" properties from the cfg file for (String key : new ArrayList<String>(this.keySet())) { if (!properties.containsKey(key)) { this.remove(key); modified = true; } } // Update existing keys for (String key : properties.keySet()) { String v = this.get(key); List<String> comments = properties.getComments(key); List<String> value = properties.getRaw(key); if (v == null) { this.put(key, comments, value); modified = true; } else if (!v.equals(properties.get(key))) { if (comments.isEmpty()) { comments = this.getComments(key); } this.put(key, comments, value); modified = true; } } return modified; }
} else if (userProps.containsKey(DEFAULT_ADMIN_USER)) { String passwordAndRole = userProps.getProperty(DEFAULT_ADMIN_USER).trim(); decodedZookeeperPassword = passwordAndRole.substring(0, passwordAndRole.indexOf(ROLE_DELIMITER));
void configureInternal(Map<String, ?> conf) throws Exception { configuration = configurer.configure(conf, this); if (Strings.isNullOrBlank(runtimeId)) { throw new IllegalArgumentException("Runtime id must not be null or empty."); } if (Strings.isNullOrBlank(localResolver)) { localResolver = globalResolver; } String decodedZookeeperPassword = null; Properties userProps = new Properties(); try { userProps.load(new File(confDir , "users.properties")); } catch (IOException e) { LOGGER.warn("Failed to load users from etc/users.properties. No users will be imported.", e); } if (Strings.isNotBlank(zookeeperPassword)) { decodedZookeeperPassword = PasswordEncoder.decode(zookeeperPassword); } else if (userProps.containsKey(DEFAULT_ADMIN_USER)) { String passwordAndRole = userProps.getProperty(DEFAULT_ADMIN_USER).trim(); decodedZookeeperPassword = passwordAndRole.substring(0, passwordAndRole.indexOf(ROLE_DELIMITER)); } else { decodedZookeeperPassword = PasswordEncoder.encode(CreateEnsembleOptions.generatePassword()); } if (userProps.isEmpty()) { userProps.put(DEFAULT_ADMIN_USER, decodedZookeeperPassword+ ROLE_DELIMITER + DEFAULT_ADMIN_ROLE); } options = CreateEnsembleOptions.builder().bindAddress(bindAddress).agentEnabled(agentAutoStart).ensembleStart(ensembleAutoStart).zookeeperPassword(decodedZookeeperPassword) .zooKeeperServerPort(zookeeperServerPort).zooKeeperServerConnectionPort(zookeeperServerConnectionPort).autoImportEnabled(profilesAutoImport) .importPath(profilesAutoImportPath).resolver(localResolver).globalResolver(globalResolver).users(userProps).profiles(profiles).version(version).build(); }