Class JsonFileSessionStore
java.lang.Object
com.sk89q.worldedit.session.storage.JsonFileSessionStore
- All Implemented Interfaces:
SessionStore
Stores sessions as JSON files in a directory.
Currently, this implementation doesn't handle thread safety very well.
-
Constructor Summary
ConstructorDescriptionJsonFileSessionStore
(File dir) Deprecated.JsonFileSessionStore
(Path dir) Create a new session store. -
Method Summary
Modifier and TypeMethodDescriptionLoad a session identified by the given UUID.void
save
(UUID id, LocalSession session) Save the given session identified by the given UUID.
-
Constructor Details
-
JsonFileSessionStore
Deprecated.Create a new session store.- Parameters:
dir
- the directory
-
JsonFileSessionStore
Create a new session store.- Parameters:
dir
- the directory
-
-
Method Details
-
load
Description copied from interface:SessionStore
Load a session identified by the given UUID.If the session does not exist (has never been saved), then a new
LocalSession
must be returned.- Specified by:
load
in interfaceSessionStore
- Parameters:
id
- the UUID- Returns:
- a session
- Throws:
IOException
- thrown on read error
-
save
Description copied from interface:SessionStore
Save the given session identified by the given UUID.- Specified by:
save
in interfaceSessionStore
- Parameters:
id
- the UUIDsession
- a session- Throws:
IOException
- thrown on read error
-
JsonFileSessionStore(Path)