org.apache.felix.utils.properties.Properties.containsKey()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(140)

本文整理了Java中org.apache.felix.utils.properties.Properties.containsKey()方法的一些代码示例,展示了Properties.containsKey()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Properties.containsKey()方法的具体详情如下:
包路径:org.apache.felix.utils.properties.Properties
类名称:Properties
方法名:containsKey

Properties.containsKey介绍

暂无

代码示例

代码示例来源:origin: io.fabric8/fabric-zookeeper

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");
}

代码示例来源:origin: jboss-fuse/fabric8

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");
}

代码示例来源:origin: apache/karaf

" 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);

代码示例来源:origin: org.apache.karaf.profile/org.apache.karaf.profile.core

" 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);

代码示例来源:origin: apache/karaf

if (configProps.containsKey("org.osgi.framework.system.packages.extra")) {
  exportPackages += "," + configProps.getProperty("org.osgi.framework.system.packages.extra");

代码示例来源:origin: org.apache.karaf.tooling/karaf-maven-plugin

if (configProps.containsKey("org.osgi.framework.system.packages.extra")) {
  exportPackages += "," + configProps.getProperty("org.osgi.framework.system.packages.extra");

代码示例来源:origin: apache/felix

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;
}

代码示例来源:origin: org.apache.felix/org.apache.felix.fileinstall

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;
}

代码示例来源:origin: org.apache.felix/org.apache.felix.utils

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;
}

代码示例来源:origin: jboss-fuse/fabric8

} else if (userProps.containsKey(DEFAULT_ADMIN_USER)) {
  String passwordAndRole = userProps.getProperty(DEFAULT_ADMIN_USER).trim();
  decodedZookeeperPassword = passwordAndRole.substring(0, passwordAndRole.indexOf(ROLE_DELIMITER));

代码示例来源:origin: io.fabric8/fabric-zookeeper

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();
}

相关文章