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 newSingleUserEncryptedFileBasedAuthInfoStore
instance. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves theOneDriveAuthInfo
from the file system.void
store
(String id, @NonNull OneDriveAuthInfo authInfo) Saves the givenauthInfo
to the file system.
-
Constructor Details
-
SingleUserEncryptedFileBasedAuthInfoStore
public SingleUserEncryptedFileBasedAuthInfoStore(@NonNull Path stateFilePath, @NonNull com.amilesend.client.crypto.CryptoHelper cryptoHelper) Creates a newSingleUserEncryptedFileBasedAuthInfoStore
instance.- 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 givenauthInfo
to the file system.- Specified by:
store
in 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 theOneDriveAuthInfo
from the file system.- Specified by:
retrieve
in 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
-