public class LocalFileUserAccessor extends Object implements IUserAccessor
| 构造器和说明 |
|---|
LocalFileUserAccessor(String userDirPath) |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
deleteUser(String username)
Delete a user's user file.
|
List<String> |
listAllUsers()
List all users existing in the database.
|
User |
loadUser(String username)
Deserialize a user from its user file.
|
void |
reset()
Re-initialize this object.
|
void |
saveUser(User user)
Serialize the user object to a temp file, then replace the old user file with the new file.
|
public LocalFileUserAccessor(String userDirPath)
public User loadUser(String username) throws IOException
loadUser 在接口中 IUserAccessorusername - The name of the user to be deserialized.IOException - if an exception is raised when interacting with the lower storage.public void saveUser(User user) throws IOException
saveUser 在接口中 IUserAccessoruser - The user object that is to be saved.IOException - if an exception is raised when interacting with the lower storage.public boolean deleteUser(String username) throws IOException
deleteUser 在接口中 IUserAccessorusername - The name of the user to be deleted.IOException - when the file cannot be deleted.public List<String> listAllUsers()
IUserAccessorlistAllUsers 在接口中 IUserAccessorpublic void reset()
IUserAccessorreset 在接口中 IUserAccessorCopyright © 2022 The Apache Software Foundation. All rights reserved.