public class OneDriveSession
extends java.lang.Object
implements java.lang.Runnable
Modifier and Type | Method and Description |
---|---|
static void |
authorizeSession(OneDriveSession session,
java.lang.String code) |
java.lang.String |
getAccessToken() |
java.lang.String |
getAccessURL() |
com.squareup.okhttp.OkHttpClient |
getClient() |
java.lang.String |
getClientID() |
java.lang.String |
getClientSecret() |
long |
getExpiresIn() |
long |
getLastRefresh() |
java.lang.String |
getRefreshToken() |
java.lang.String |
getScopeString() |
java.lang.String |
getTokenType() |
static OneDriveSession |
initializeSession(com.squareup.okhttp.OkHttpClient client,
java.lang.String clientID,
java.lang.String clientSecret,
java.lang.String redirect_uri,
ExceptionEventHandler exceptionCallback,
OneDriveScope[] scopes)
creates a OneDriveSession used to handle the authentication process
|
static OneDriveSession |
initializeSession(com.squareup.okhttp.OkHttpClient client,
java.lang.String clientID,
java.lang.String clientSecret,
java.lang.String redirect_uri,
OneDriveScope... scopes) |
boolean |
isAuthenticated() |
static OneDriveSession |
readFromFile(java.io.File f) |
void |
refresh() |
static void |
refreshSession(OneDriveSession session,
java.lang.String refreshToken) |
void |
run() |
void |
setAccessToken(java.lang.String accessToken) |
void |
setExpiresIn(long expiresIn) |
void |
setLastRefresh(long lastRefresh) |
void |
setRefreshToken(java.lang.String refreshToken) |
void |
setTokenType(java.lang.String tokenType) |
void |
startRefreshThread() |
void |
terminate() |
java.lang.String |
toString() |
static void |
write(OneDriveSession that,
java.io.File outputFile) |
public static OneDriveSession initializeSession(com.squareup.okhttp.OkHttpClient client, java.lang.String clientID, java.lang.String clientSecret, java.lang.String redirect_uri, ExceptionEventHandler exceptionCallback, OneDriveScope[] scopes)
client
- Used for HTTP CommunicationclientID
- @see https://dev.onedrive.com/auth/msa_oauth.htm CodeFlowclientSecret
- @see https://dev.onedrive.com/auth/msa_oauth.htm CodeFlowredirect_uri
- @see https://dev.onedrive.com/auth/msa_oauth.htm can be nullexceptionCallback
- Method that is called if the RefreshLoop encounters an exceptionscopes
- @see https://dev.onedrive.com/auth/msa_oauth.htmpublic static OneDriveSession initializeSession(com.squareup.okhttp.OkHttpClient client, java.lang.String clientID, java.lang.String clientSecret, java.lang.String redirect_uri, OneDriveScope... scopes)
public static void authorizeSession(OneDriveSession session, java.lang.String code) throws OneDriveException
OneDriveException
public static void refreshSession(OneDriveSession session, java.lang.String refreshToken) throws OneDriveException
OneDriveException
public static OneDriveSession readFromFile(java.io.File f) throws java.io.IOException
java.io.IOException
public static void write(OneDriveSession that, java.io.File outputFile) throws java.io.IOException, OneDriveException
java.io.IOException
OneDriveException
public long getLastRefresh()
public void setLastRefresh(long lastRefresh)
public boolean isAuthenticated()
public com.squareup.okhttp.OkHttpClient getClient()
public java.lang.String getClientID()
public java.lang.String getClientSecret()
public java.lang.String getScopeString()
public java.lang.String getTokenType()
public void setTokenType(java.lang.String tokenType)
public long getExpiresIn()
public void setExpiresIn(long expiresIn)
public java.lang.String getAccessToken()
public void setAccessToken(java.lang.String accessToken)
public java.lang.String getRefreshToken()
public void setRefreshToken(java.lang.String refreshToken)
public void refresh() throws OneDriveException
OneDriveException
public java.lang.String getAccessURL()
public java.lang.String toString()
toString
in class java.lang.Object
public void run()
run
in interface java.lang.Runnable
public void startRefreshThread()
public void terminate()