Class JsonFileStore

java.lang.Object
com.codingchili.core.files.JsonFileStore
All Implemented Interfaces:
FileStore

public class JsonFileStore extends Object implements FileStore
Handles the loading/writing of json objects and lists to/from disk.
  • Constructor Details

    • JsonFileStore

      public JsonFileStore()
  • Method Details

    • readObject

      public io.vertx.core.json.JsonObject readObject(io.vertx.core.buffer.Buffer buffer)
      Description copied from interface: FileStore
      Reads a T object from a specified application-relative path.
      Specified by:
      readObject in interface FileStore
      Parameters:
      buffer - data of the object to read to json
      Returns:
      the loaded json object.
    • writeObject

      public void writeObject(io.vertx.core.json.JsonObject json, Path path)
      Description copied from interface: FileStore
      Writes a json-object to the given path.
      Specified by:
      writeObject in interface FileStore
      Parameters:
      json - the object to write.
      path - the path to where the object is written to.
    • getExtensions

      public List<String> getExtensions()
      Specified by:
      getExtensions in interface FileStore
      Returns:
      the extension handled by this file store.