MCPcopy
hub / github.com/OpenTSDB/opentsdb / contentToProps

Method contentToProps

test/tools/TestConfigArgP.java:394–406  ·  view source on GitHub ↗

Converts the passed stringy to a properties instance @param content The content to format @return the properties instance

(final CharSequence content)

Source from the content-addressed store, hash-verified

392 * @return the properties instance
393 */
394 protected Properties contentToProps(final CharSequence content) {
395 Properties p = new Properties();
396 try {
397 p.load(new StringReader(content.toString()));
398 Properties converted = new Properties();
399 for(String key: p.stringPropertyNames()) {
400 converted.put(key, ConfigArgP.processConfigValue(p.getProperty(key)));
401 }
402 return converted;
403 } catch (Exception ex) {
404 throw new RuntimeException(ex);
405 }
406 }
407
408 /**
409 * Converts the passed config to a readable properties file, applying the passed overrides

Calls 3

processConfigValueMethod · 0.95
putMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected