/** * Calls the map method put. Provided for parallelism with the getProperty method. * Enforces use of strings for property keys and values. The value returned is the result of the map call to put. * * @param key the key to be placed into this property list. * @param value the value corresponding to the key. * @return the previous value of the specified key in this property list, or null if it did not have one. */ public Object setProperty(String key, String value) { return this.put(key, value); }
/** * Calls the map method put. Provided for parallelism with the getProperty method. * Enforces use of strings for property keys and values. The value returned is the result of the map call to put. * * @param key the key to be placed into this property list. * @param value the value corresponding to the key. * @return the previous value of the specified key in this property list, or null if it did not have one. */ public Object setProperty(String key, String value) { return this.put(key, value); }
/** * Calls the map method put. Provided for parallelism with the getProperty method. * Enforces use of strings for property keys and values. The value returned is the result of the map call to put. * * @param key the key to be placed into this property list. * @param value the value corresponding to the key. * @return the previous value of the specified key in this property list, or null if it did not have one. */ public Object setProperty(String key, String value) { return this.put(key, value); }
public Object put(String key, List<String> commentLines, List<String> valueLines) { String old = storage.put(key, commentLines, valueLines); return old != null ? storage.typed ? convertFromString(old) : old : 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(); }
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); }
private static void trimValues(Properties configProps) { for (String key : configProps.keySet()) { configProps.put(key, configProps.get(key).trim()); } }
public void setFramework(FrameworkType framework) { if (framework == null) { return; } try { Properties properties = loadProps(); properties.put("karaf.framework", framework.name()); properties.save(); } catch (IOException e) { throw new RuntimeException("Error setting framework: " + e.getMessage(), e); } }
public Object put(String key, List<String> commentLines, Object value) { if (value instanceof String && !storage.typed) { return storage.put(key, commentLines, (String) value); } else { ensureTyped(); return put(key, commentLines, Arrays.asList(convertToString(value).split("\n"))); } }
public Object put(String key, List<String> commentLines, Object value) { if (value instanceof String && !storage.typed) { return storage.put(key, commentLines, (String) value); } else { ensureTyped(); return put(key, commentLines, Arrays.asList(convertToString(value).split("\n"))); } }
public Object put(String key, List<String> commentLines, Object value) { if (value instanceof String && !storage.typed) { return storage.put(key, commentLines, (String) value); } else { ensureTyped(); return put(key, commentLines, Arrays.asList(convertToString(value).split("\n"))); } }
public void setFramework(FrameworkType framework) { if (framework == null) { return; } try { Properties properties = loadProps(); properties.put("karaf.framework", framework.name()); properties.save(); } catch (IOException e) { throw new RuntimeException("Error setting framework: " + e.getMessage(), e); } }
private void ensureTyped() { if (!storage.typed) { storage.typed = true; Set<String> keys = new HashSet<String>(storage.keySet()); for (String key : keys) { storage.put(key, storage.getComments(key), Arrays.asList(convertToString(storage.get(key)).split("\n"))); } } }
private void ensureTyped() { if (!storage.typed) { storage.typed = true; Set<String> keys = new HashSet<String>(storage.keySet()); for (String key : keys) { storage.put(key, storage.getComments(key), Arrays.asList(convertToString(storage.get(key)).split("\n"))); } } }
private void ensureTyped() { if (!storage.typed) { storage.typed = true; Set<String> keys = new HashSet<String>(storage.keySet()); for (String key : keys) { storage.put(key, storage.getComments(key), Arrays.asList(convertToString(storage.get(key)).split("\n"))); } } }