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 newSingleUserFileBasedAuthInfoStoreinstance. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves theOneDriveAuthInfofrom the file system.voidstore(String id, @NonNull OneDriveAuthInfo authInfo) Saves the givenauthInfoto the file system.
-
Constructor Details
-
SingleUserFileBasedAuthInfoStore
Creates a newSingleUserFileBasedAuthInfoStoreinstance.- Parameters:
stateFilePath- The path to save and read from.
-
-
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
-