|
|
@ -30,7 +30,6 @@ public class DataStoreBot {
|
|
|
|
e.printStackTrace();
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}, 0, seconds, TimeUnit.SECONDS);
|
|
|
|
}, 0, seconds, TimeUnit.SECONDS);
|
|
|
|
//ses.shutdown();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
public Runnable storeLatestEntry() throws IOException, ParseException {
|
|
|
|
public Runnable storeLatestEntry() throws IOException, ParseException {
|
|
|
|
JSONArray APIData = this.api.getJSONObject();
|
|
|
|
JSONArray APIData = this.api.getJSONObject();
|
|
|
@ -53,8 +52,7 @@ public class DataStoreBot {
|
|
|
|
String timestamp = (String) entry.get("timestamp");
|
|
|
|
String timestamp = (String) entry.get("timestamp");
|
|
|
|
|
|
|
|
|
|
|
|
String path = this.storePath + country + "-" + sensorID + "-" + timestamp + ".json";
|
|
|
|
String path = this.storePath + country + "-" + sensorID + "-" + timestamp + ".json";
|
|
|
|
path = path.replace(":", "-");
|
|
|
|
path = path.replace(":", "-").replace(" ", "-");
|
|
|
|
path = path.replace(" ", "-");
|
|
|
|
|
|
|
|
this.store.storeJSON(path, entry);
|
|
|
|
this.store.storeJSON(path, entry);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|