|
|
|
@ -128,8 +128,6 @@ public class PropertyManager { |
|
|
|
|
props.cfgBlankRowBetweenSections = cfgSeparateSections; |
|
|
|
|
props.cfgBlankRowBeforeComment = cfgNewlineBeforeComments; |
|
|
|
|
|
|
|
|
|
final ArrayList<String> keyList = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
// rename keys
|
|
|
|
|
for (final Entry<String, String> entry : renameTable.entrySet()) { |
|
|
|
|
|
|
|
|
@ -141,22 +139,29 @@ public class PropertyManager { |
|
|
|
|
props.setProperty(entry.getValue(), pr); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// validate entries one by one, replace with default when needed
|
|
|
|
|
for (final Property<?> entry : entries.values()) { |
|
|
|
|
keyList.add(entry.getKey()); |
|
|
|
|
entry.parse(props.getProperty(entry.getKey())); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
renameTable.clear(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
final String propOrig = props.getProperty(entry.getKey()); |
|
|
|
|
public void save() |
|
|
|
|
{ |
|
|
|
|
try { |
|
|
|
|
final ArrayList<String> keyList = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
entry.parse(propOrig); |
|
|
|
|
// validate entries one by one, replace with default when needed
|
|
|
|
|
for (final Property<?> entry : entries.values()) { |
|
|
|
|
keyList.add(entry.getKey()); |
|
|
|
|
|
|
|
|
|
if (entry.getComment() != null) { |
|
|
|
|
props.setKeyComment(entry.getKey(), entry.getComment()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (propOrig == null || !entry.toString().equals(propOrig)) { |
|
|
|
|
props.setProperty(entry.getKey(), entry.toString()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// removed unused props
|
|
|
|
|
for (final String propname : props.keySet().toArray(new String[props.size()])) { |
|
|
|
@ -165,13 +170,6 @@ public class PropertyManager { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
renameTable.clear(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void save() |
|
|
|
|
{ |
|
|
|
|
try { |
|
|
|
|
props.store(new FileOutputStream(file), fileComment); |
|
|
|
|
} catch (final IOException ioe) { |
|
|
|
|
ioe.printStackTrace(); |
|
|
|
|