Converts the passed config to a readable properties file, applying the passed overrides @param config The config to write @param overrides The overrides to apply @return The rendered content
(final Config config, Map<String, String>...overrides)
| 412 | * @return The rendered content |
| 413 | */ |
| 414 | protected String configToContent(final Config config, Map<String, String>...overrides) { |
| 415 | Properties p = new Properties(); |
| 416 | for(Map.Entry<String, String> entry: config.getMap().entrySet()) { |
| 417 | String vl = entry.getValue(); |
| 418 | if(vl==null || vl.trim().isEmpty()) continue; |
| 419 | p.put(entry.getKey(), vl); |
| 420 | } |
| 421 | for(Map<String, String> map: overrides) { |
| 422 | p.putAll(map); |
| 423 | } |
| 424 | StringBuilder b = new StringBuilder(); |
| 425 | for(String key: p.stringPropertyNames()) { |
| 426 | b.append(key).append("=") |
| 427 | .append(p.getProperty(key)) |
| 428 | .append(EOL); |
| 429 | } |
| 430 | return b.toString(); |
| 431 | } |
| 432 | |
| 433 | |
| 434 | static interface QuickieResponder { |