Interface PasswordStore
- All Known Implementing Classes:
BasicPasswordManager
@NullMarked
public interface PasswordStore
Represents a class which can manage a password value.
-
Method Summary
Modifier and TypeMethodDescriptionbooleancheckPassword(String input) Check whether the input password is correct.@Nullable StringGet the current password.voidreload()Reload the password from disk.voidsetNewPassword(@Nullable String password) Set a new password and write it to disk.
-
Method Details
-
reload
Reload the password from disk.- Throws:
IOException- if an exception occurs while reading the file
-
getCurrentPassword
@Nullable String getCurrentPassword()Get the current password.- Returns:
- password, or
nullif none set
-
checkPassword
Check whether the input password is correct.- Parameters:
input- the input password- Returns:
- if the input matches the password, or
trueif no password is set
-
setNewPassword
Set a new password and write it to disk.- Parameters:
password- the new password, ornullto unset the password- Throws:
IOException- if an exception occurs while writing to the file
-