Class SingleUserEncryptedFileBasedAuthInfoStore
java.lang.Object
com.amilesend.onedrive.connection.auth.store.SingleUserEncryptedFileBasedAuthInfoStore
- All Implemented Interfaces:
AuthInfoStore
An
AuthInfoStore implementation that stores and retrieves encrypted user authentication information
to the filesystem. This assumes a single user associated with the specified file path, which means
that any provided keyed identifiers are ignored.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSingleUserEncryptedFileBasedAuthInfoStore(@NonNull Path stateFilePath, @NonNull com.amilesend.client.crypto.CryptoHelper cryptoHelper) Creates a newSingleUserEncryptedFileBasedAuthInfoStoreinstance. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves theOneDriveAuthInfofrom the file system.voidstore(String id, @NonNull OneDriveAuthInfo authInfo) Saves the givenauthInfoto the file system.
-
Constructor Details
-
SingleUserEncryptedFileBasedAuthInfoStore
public SingleUserEncryptedFileBasedAuthInfoStore(@NonNull Path stateFilePath, @NonNull com.amilesend.client.crypto.CryptoHelper cryptoHelper) Creates a newSingleUserEncryptedFileBasedAuthInfoStoreinstance.- Parameters:
stateFilePath- The path to save and read from.cryptoHelper- The crypto helper instance used to encrypt and decrypt the auth info file state contents.
-
-
Method Details
-
store
Saves the givenauthInfoto the file system.- Specified by:
storein interfaceAuthInfoStore- Parameters:
id- is ignored for this implementationauthInfo- the authentication information- Throws:
AuthInfoStoreException- if an error occurred while saving the authentication info to the file system- See Also:
-
retrieve
Retrieves theOneDriveAuthInfofrom the file system.- Specified by:
retrievein interfaceAuthInfoStore- Parameters:
id- is ignored for this implementation- Returns:
- the authentication information, or
null - Throws:
AuthInfoStoreException- if an error occurred while retrieving the authentication info from the file system
-