You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
571 B
Java
21 lines
571 B
Java
package sh.adb.sensorCommunityAPI;
|
|
|
|
import org.json.simple.JSONObject;
|
|
|
|
import java.io.FileWriter;
|
|
import java.io.IOException;
|
|
|
|
public class DataStore {
|
|
public boolean storeJSON(String path, JSONObject json) throws IOException {
|
|
FileWriter fw = new FileWriter(path);
|
|
try {
|
|
System.out.println(json.toString());
|
|
fw.write(json.toString());
|
|
fw.close();
|
|
return true;
|
|
}catch (IOException e){
|
|
System.out.println("error wile soring data to: " + path);
|
|
}
|
|
return false;
|
|
}
|
|
} |