Class OneDriveConnectionBuilder
java.lang.Object
com.amilesend.onedrive.connection.OneDriveConnectionBuilder
Builder to configure and return a new
OneDriveConnection instance.-
Method Summary
Modifier and TypeMethodDescriptionauthManager(OneDriveAuthManager authManager) TheOneDriveAuthManagerused to manage authentication and access tokens.build(OneDriveAuthInfo authInfo) Builds a newOneDriveConnectioninstance with the givenauthInfo.Builds a newOneDriveConnectioninstance with the givenauthCode.The application client identifier.clientSecret(String clientSecret) The application client secret.httpClient(okhttp3.OkHttpClient httpClient) The underlying http client.static OneDriveConnectionBuilderCreates a newOneDriveConnectionBuilderinstance.redirectUrl(String redirectUrl) The OAuth redirect URL.Sets the user-agent string that is included in requests.
-
Method Details
-
newInstance
Creates a newOneDriveConnectionBuilderinstance.- Returns:
- the builder
-
userAgent
Sets the user-agent string that is included in requests.- Parameters:
userAgent- the user agent- Returns:
- this builder
-
httpClient
The underlying http client. This is optional.- Parameters:
httpClient- the http client- Returns:
- this builder
-
clientId
The application client identifier. This is required.- Parameters:
clientId- the application client identifier- Returns:
- this builder
-
clientSecret
The application client secret. This is required.- Parameters:
clientSecret- the application client secret- Returns:
- this builder
-
redirectUrl
The OAuth redirect URL. This is required.- Parameters:
redirectUrl- the OAuth redirectUrl- Returns:
- this builder
-
authManager
TheOneDriveAuthManagerused to manage authentication and access tokens.- Parameters:
authManager- the auth manager- Returns:
- this builder
-
build
Builds a newOneDriveConnectioninstance with the givenauthCode.- Parameters:
authCode- the authorization code obtained from the OAuth handshake.- Returns:
- the connection
-
build
Builds a newOneDriveConnectioninstance with the givenauthInfo.- Parameters:
authInfo- the authorization information that contains the refresh token- Returns:
- the connection
-