mirror of
https://gitlab.com/kauron/jstudy
synced 2024-12-22 16:33:33 +01:00
Config: defaults
This commit is contained in:
parent
51779fb868
commit
c83f765c35
1 changed files with 17 additions and 12 deletions
|
@ -22,19 +22,24 @@ public class AppConfig {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void load() {
|
public static void load() {
|
||||||
try {
|
File file = new File(FILE);
|
||||||
Scanner in = new Scanner(new File(FILE));
|
if (!file.exists()) {
|
||||||
while (in.hasNextLine()) {
|
repeatWrong = true;
|
||||||
String line = in.nextLine();
|
showFeedback = true;
|
||||||
String value = line.substring(line.indexOf('=') + 1);
|
} else
|
||||||
if (line.matches("repeatWrong=.*"))
|
try {
|
||||||
repeatWrong = Boolean.parseBoolean(value);
|
Scanner in = new Scanner(new File(FILE));
|
||||||
else if (line.matches("showFeedback=.*"))
|
while (in.hasNextLine()) {
|
||||||
showFeedback = Boolean.parseBoolean(value);
|
String line = in.nextLine();
|
||||||
|
String value = line.substring(line.indexOf('=') + 1);
|
||||||
|
if (line.matches("repeatWrong=.*"))
|
||||||
|
repeatWrong = Boolean.parseBoolean(value);
|
||||||
|
else if (line.matches("showFeedback=.*"))
|
||||||
|
showFeedback = Boolean.parseBoolean(value);
|
||||||
|
}
|
||||||
|
} catch (FileNotFoundException e) {
|
||||||
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
} catch (FileNotFoundException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String printValues() {
|
public static String printValues() {
|
||||||
|
|
Loading…
Reference in a new issue