Class SingleUserFileBasedAuthInfoStore
java.lang.Object
com.amilesend.onedrive.connection.auth.store.SingleUserFileBasedAuthInfoStore
- All Implemented Interfaces:
AuthInfoStore
A simple
AuthInfoStore
implementation that stores and retrieves 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
ConstructorsConstructorDescriptionSingleUserFileBasedAuthInfoStore
(@NonNull Path stateFilePath) Creates a newSingleUserFileBasedAuthInfoStore
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
-
SingleUserFileBasedAuthInfoStore
Creates a newSingleUserFileBasedAuthInfoStore
instance.- Parameters:
stateFilePath
- The path to save and read from.
-
-
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
-