#12 ominaisuus valmis
This commit is contained in:
@@ -21,8 +21,9 @@ public class Main {
|
||||
}
|
||||
|
||||
try {
|
||||
properties = new Properties();
|
||||
properties.load(Main.class.getClassLoader().getResourceAsStream("defaults.properties"));
|
||||
Properties defaults = new Properties();
|
||||
defaults.load(Main.class.getClassLoader().getResourceAsStream("defaults.properties"));
|
||||
properties = new Properties(defaults);
|
||||
properties.load(new FileInputStream(asetustiedosto));
|
||||
}
|
||||
catch (IOException e) {
|
||||
@@ -30,9 +31,8 @@ public class Main {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
properties.forEach((key, value) -> {
|
||||
System.out.println(key + ": " + value);
|
||||
});
|
||||
System.out.println(properties.getProperty("version"));
|
||||
System.out.println(properties.getProperty("viimeisinVersio"));
|
||||
|
||||
App.main();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user