-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathConfig.java
More file actions
80 lines (64 loc) · 2.05 KB
/
Copy pathConfig.java
File metadata and controls
80 lines (64 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
public class Config {
//Read the config file
private String undervolt_path;
private String save_path;
private String image_path;
private String script_path;
public Config(){
readConfigFile();
}
private void readConfigFile(){
BufferedReader reader;
try {
reader = new BufferedReader(new FileReader("resource/config.txt"));
String line = reader.readLine();
while (line != null) {
// System.out.println(line);
if(line.contains("undervolt_path")){
String value = getValue(line);
undervolt_path = value;
}
if(line.contains("save_path")){
String value = getValue(line);
save_path = value;
}
if(line.contains("image_path")){
String value = getValue(line);
image_path = value;
}
if(line.contains("script_path")){
String value = getValue(line);
script_path = value;
}
line = reader.readLine();
}
reader.close();
} catch (IOException e) {
e.printStackTrace();
}
}
private String getValue(String line) {
line = line.replace(" ","");
String path[] = line.split("=");
return path[1];
}
public String getUndervolt_path() {
//System.out.println("Undervolt path: " + undervolt_path);
return undervolt_path;
}
public String getSave_path() {
//System.out.println("Save path: " + save_path);
return save_path;
}
public String getImage_path() {
// System.out.println("Image path: " + image_path);
return image_path;
}
public String getScript_path() {
//System.out.println("String path: " + script_path);
return script_path;
}
}