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.
22 lines
537 B
Java
22 lines
537 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 {
|
|
boolean check = false;
|
|
|
|
FileWriter file = new FileWriter(path);
|
|
try {
|
|
file.write(json.toJSONString());
|
|
check = true;
|
|
}catch (IOException e){
|
|
System.out.println("Sorry cant write in file" + path);
|
|
}
|
|
return check;
|
|
}
|
|
} |