Package com.codingchili.core.files
Class JsonFileStore
java.lang.Object
com.codingchili.core.files.JsonFileStore
- All Implemented Interfaces:
FileStore
Handles the loading/writing of json objects and lists to/from disk.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionio.vertx.core.json.JsonObject
readObject(io.vertx.core.buffer.Buffer buffer)
Reads a T object from a specified application-relative path.void
writeObject(io.vertx.core.json.JsonObject json, Path path)
Writes a json-object to the given path.
-
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 interfaceFileStore
- Parameters:
buffer
- data of the object to read to json- Returns:
- the loaded json object.
-
writeObject
Description copied from interface:FileStore
Writes a json-object to the given path.- Specified by:
writeObject
in interfaceFileStore
- Parameters:
json
- the object to write.path
- the path to where the object is written to.
-
getExtensions
- Specified by:
getExtensions
in interfaceFileStore
- Returns:
- the extension handled by this file store.
-