Added config file existence check
This commit is contained in:
parent
2a04f3a29b
commit
0afb7553a9
@ -52,7 +52,7 @@ dependencies {
|
|||||||
compile 'org.pcap4j:pcap4j-core:1.7.0'
|
compile 'org.pcap4j:pcap4j-core:1.7.0'
|
||||||
compile 'org.pcap4j:pcap4j-packetfactory-propertiesbased:1.7.0'
|
compile 'org.pcap4j:pcap4j-packetfactory-propertiesbased:1.7.0'
|
||||||
compile 'de.measite.minidns:minidns-core:0.2.1'
|
compile 'de.measite.minidns:minidns-core:0.2.1'
|
||||||
compile 'com.google.code.gson:gson:2.8.0'
|
compile 'com.google.code.gson:gson:2.8.1'
|
||||||
|
|
||||||
compile 'com.google.firebase:firebase-crash:10.2.6'
|
compile 'com.google.firebase:firebase-crash:10.2.6'
|
||||||
|
|
||||||
|
@ -125,12 +125,14 @@ public class Configurations {
|
|||||||
public static Configurations load(File file) {
|
public static Configurations load(File file) {
|
||||||
Configurations.file = file;
|
Configurations.file = file;
|
||||||
Configurations config = null;
|
Configurations config = null;
|
||||||
|
if (file.exists()) {
|
||||||
try {
|
try {
|
||||||
config = Daedalus.parseJson(Configurations.class, new JsonReader(new FileReader(file)));
|
config = Daedalus.parseJson(Configurations.class, new JsonReader(new FileReader(file)));
|
||||||
Logger.info("Loading configuration successfully from " + file);
|
Logger.info("Loading configuration successfully from " + file);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Logger.logException(e);
|
Logger.logException(e);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (config == null) {
|
if (config == null) {
|
||||||
config = new Configurations();
|
config = new Configurations();
|
||||||
|
Loading…
Reference in New Issue
Block a user