public TypedProperties(SubstitutionCallback callback, boolean substitute) { this.storage = new Properties(false); this.callback = callback; this.substitute = substitute; }
public TypedProperties(SubstitutionCallback callback, boolean substitute) { this.storage = new Properties(false); this.callback = callback; this.substitute = substitute; }
public TypedProperties(SubstitutionCallback callback, boolean substitute) { this.storage = new Properties(false); this.callback = callback; this.substitute = substitute; }
private Properties loadProps() throws IOException { return new Properties(new File(System.getProperty("karaf.etc"), "config.properties")); }
private Properties loadProps() throws IOException { return new Properties(new File(System.getProperty("karaf.etc"), "config.properties")); }
@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); } }
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; }
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); } }
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; }
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"); }
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; }
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; } }
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(); }
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(); }
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); }
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); }
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); }
@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); }
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; }
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; }