Skip to content
This repository was archived by the owner on Nov 27, 2021. It is now read-only.

File Handling

MatthewTGM edited this page Jun 30, 2021 · 2 revisions
import xyz.matthewtgm.json.entities.JsonObject;
import xyz.matthewtgm.json.files.JsonReader;
import xyz.matthewtgm.json.files.JsonWriter;

public class FilesExampleApplication {

    public static FilesExampleApplication instance = new FilesExampleApplication();

    public void start() {
        JsonObject savedObject = new JsonObject();
        savedObject.add("data", "data_object");
        JsonWriter.write("saved", savedObject, true);

        System.out.println(JsonReader.read("saved").toString());
    }

    public static void main(String[] args) {
        FilesExampleApplication.instance.start();
    }

}

JsonTGM has a built-in JSON reader and writer. These can be used as shown above.

Clone this wiki locally