#1467 Create backup before migrating; output newly added message keys

- Extract logic for creating a backup timestamp into FileUtils
This commit is contained in:
ljacqu
2018-02-13 22:15:03 +01:00
parent ffeb04c0a2
commit 9dd4039fdd
6 changed files with 94 additions and 20 deletions
@@ -19,7 +19,7 @@ import java.util.Objects;
* Implementation of {@link PropertyReader} which can read a file or a stream with
* a specified charset.
*/
public class MessageMigraterPropertyReader implements PropertyReader {
public final class MessageMigraterPropertyReader implements PropertyReader {
public static final Charset CHARSET = StandardCharsets.UTF_8;
@@ -31,6 +31,12 @@ public class MessageMigraterPropertyReader implements PropertyReader {
root = valuesMap;
}
/**
* Creates a new property reader for the given file.
*
* @param file the file to load
* @return the created property reader
*/
public static MessageMigraterPropertyReader loadFromFile(File file) {
Map<String, Object> valuesMap;
try (InputStream is = new FileInputStream(file)) {