Interface IPlatformSettings
-
public interface IPlatformSettings
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description byte[]
loadFile(java.lang.String filename)
Directly loads a file from the settings directory.java.lang.Object
loadState(java.lang.String id)
Loads arbitrary state form a persistent directory.void
saveFile(java.lang.String filename, byte[] content)
Directly saves a file in the settings directory.void
saveState(java.lang.String id, java.lang.Object state)
Saves arbitrary state to a persistent directory as JSON.
-
-
-
Method Detail
-
saveState
void saveState(java.lang.String id, java.lang.Object state)
Saves arbitrary state to a persistent directory as JSON. Object must be serializable and the ID must be unique.- Parameters:
id
- Unique ID for the saved state.state
- The state being saved.
-
loadState
java.lang.Object loadState(java.lang.String id)
Loads arbitrary state form a persistent directory.- Parameters:
id
- Unique ID for the saved state.- Returns:
- The state or null if none was found or corrupt.
-
saveFile
void saveFile(java.lang.String filename, byte[] content)
Directly saves a file in the settings directory.- Parameters:
filename
- Name of the file.content
- The file content.
-
loadFile
byte[] loadFile(java.lang.String filename)
Directly loads a file from the settings directory.- Parameters:
filename
- Name of the file.- Returns:
- Content of the file or null if not found.
-
-