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

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

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

Properties.<init>介绍

暂无

代码示例

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

public TypedProperties(SubstitutionCallback callback, boolean substitute) {
  this.storage = new Properties(false);
  this.callback = callback;
  this.substitute = substitute;
}

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

public TypedProperties(SubstitutionCallback callback, boolean substitute) {
  this.storage = new Properties(false);
  this.callback = callback;
  this.substitute = substitute;
}

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

public TypedProperties(SubstitutionCallback callback, boolean substitute) {
  this.storage = new Properties(false);
  this.callback = callback;
  this.substitute = substitute;
}

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

private Properties loadProps() throws IOException {
  return new Properties(new File(System.getProperty("karaf.etc"), "config.properties"));
}

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

private Properties loadProps() throws IOException {
  return new Properties(new File(System.getProperty("karaf.etc"), "config.properties"));
}

代码示例来源:origin: codice/ddf

@Override
 public Dictionary<String, Object> read(InputStream in) throws IOException {
  notNull(in, "Input stream cannot be null");
  final Properties props = new Properties();
  props.load(in);
  return new Hashtable<>(props);
 }
}

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

public BackingEngine build(Map<String, ?> options) {
  PublickeyBackingEngine engine = null;
  String usersFile = (String) options.get(USER_FILE);
  File f = new File(usersFile);
  Properties users;
  try {
    users = new Properties(f);
    return new PublickeyBackingEngine(users);
  } catch (IOException ioe) {
    logger.warn("Cannot open keys file:" + usersFile);
  }
  return engine;
}

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

public static Properties toProperties(byte[] source)  {
  try {
    Properties rc = new Properties(false);
    if (source != null) {
      rc.load(new ByteArrayInputStream(source));
    }
    return rc;
  } catch (IOException ex) {
    throw new IllegalArgumentException("Cannot load properties", ex);
  }
}

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

public static Properties toProperties(Map<String, String> source) {
  if (source instanceof Properties) {
    return (Properties) source;
  }
  Properties rc = new Properties(false);
  rc.putAll(source);
  return rc;
}

代码示例来源: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: org.apache.karaf.jaas/org.apache.karaf.jaas.modules

public BackingEngine build(Map<String, ?> options) {
  PublickeyBackingEngine engine = null;
  String usersFile = (String) options.get(USER_FILE);
  File f = new File(usersFile);
  Properties users;
  try {
    users = new Properties(f);
    return new PublickeyBackingEngine(users);
  } catch (IOException ioe) {
    logger.warn("Cannot open keys file:" + usersFile);
  }
  return engine;
}

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

protected static Properties loadPropertiesFile(URL configPropURL) throws Exception {
  try (
    InputStream is = configPropURL.openConnection().getInputStream()
  ){
    Properties configProps = new Properties();
    configProps.load(is);
    return configProps;
  }
  catch (Exception ex) {
    System.err.println("Error loading config properties from " + configPropURL);
    System.err.println("Main: " + ex);
    return null;
  }
}

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

private void markCreated(BundleContext bundleContext) throws IOException {
  File marker = new File(dataDir, ENSEMBLE_MARKER);
  if (!marker.exists() && !marker.getParentFile().exists() && !marker.getParentFile().mkdirs()) {
    throw new IOException("Cannot create marker file");
  }
  org.apache.felix.utils.properties.Properties props = new org.apache.felix.utils.properties.Properties(marker);
  props.put("created", "true");
  props.save();
}

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

private void markCreated(BundleContext bundleContext) throws IOException {
  File marker = new File(dataDir, ENSEMBLE_MARKER);
  if (!marker.exists() && !marker.getParentFile().exists() && !marker.getParentFile().mkdirs()) {
    throw new IOException("Cannot create marker file");
  }
  org.apache.felix.utils.properties.Properties props = new org.apache.felix.utils.properties.Properties(marker);
  props.put("created", "true");
  props.save();
}

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

public boolean update(Map<String, String> props) {
  Properties properties;
  if (props instanceof Properties) {
    properties = (Properties) props;
  } else {
    properties = new Properties();
    for (Map.Entry<? extends String, ? extends String> e : props.entrySet()) {
      properties.put(e.getKey(), e.getValue());
    }
  }
  return update(properties);
}

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

public boolean update(Map<String, String> props) {
  Properties properties;
  if (props instanceof Properties) {
    properties = (Properties) props;
  } else {
    properties = new Properties();
    for (Map.Entry<? extends String, ? extends String> e : props.entrySet()) {
      properties.put(e.getKey(), e.getValue());
    }
  }
  return update(properties);
}

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

public boolean update(Map<String, String> props) {
  Properties properties;
  if (props instanceof Properties) {
    properties = (Properties) props;
  } else {
    properties = new Properties();
    for (Map.Entry<? extends String, ? extends String> e : props.entrySet()) {
      properties.put(e.getKey(), e.getValue());
    }
  }
  return update(properties);
}

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

@Override
public String setSystemProperty(String key, String value, boolean persist) {
  if (persist) {
    try {
      String etc = System.getProperty("karaf.etc");
      Properties props = new Properties(new File(etc, "system.properties"));
      props.put(key, value);
      props.save();
    } catch (IOException e) {
      throw new RuntimeException("Error persisting system property", e);
    }
  }
  return System.setProperty(key, value);
}

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

public Properties getProperties() {
  Properties props = new Properties();
  try {
    org.apache.felix.utils.properties.Properties properties
        = new org.apache.felix.utils.properties.Properties();
    properties.load(new StringReader(value));
    for (Map.Entry<String, String> e : properties.entrySet()) {
      props.put(e.getKey(), e.getValue());
    }
  } catch (IOException e) {
    // ignore??
  }
  return props;
}

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

private Properties loadPaxLoggingConfig() {
  Properties props = new Properties();
  FileInputStream fis = null;
  try {
    fis = new FileInputStream(log4jConfigPath);
    props.load(fis);
  } catch (Exception e) {
    // Ignore
  } finally {
    close(fis);
  }
  return props;
}

相关文章