|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.smartfile.api.Client
com.smartfile.api.OAuthClient
public class OAuthClient
Implements Smartfile API client using OAuth1 authentication. Provide credentials within constructor or environment variables.
Example of usage:
Scanner scan = new Scanner(System.in);
OAuthClient api = new OAuthClient("***********","*************");
api.get_request_token();
System.out.println(api.get_authorization_url());
api.get_access_token(scan.nextLine());
Client for details of API call.| Constructor Summary | |
|---|---|
OAuthClient()
Creates OAuth client using credentials stored at environment variables SMARTFILE_CLIENT_TOKEN and SMARTFILE_CLIENT_SECRET |
|
OAuthClient(java.lang.String client_token,
java.lang.String client_secret)
Creates OAuth client |
|
| Method Summary | |
|---|---|
void |
get_access_token(java.lang.String verifier)
Retrieves access token |
java.lang.String |
get_authorization_url()
Returns an URL where Verifier must be obtained |
void |
get_request_token()
Retrieves request token |
void |
get_request_token(java.lang.String callback)
Retrieves request token to a specific callback |
| Methods inherited from class com.smartfile.api.Client |
|---|
addHeader, delete, delete, delete, delete, get, get, get, get, getApiUrl, post, post, post, post, post, put, put, put, put, setApiUrl, setApiUrl |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public OAuthClient()
public OAuthClient(java.lang.String client_token,
java.lang.String client_secret)
throws SmartFileException
client_token - Client Tokenclient_secret - Client Secret
SmartFileException| Method Detail |
|---|
public void get_request_token()
throws SmartFileException
SmartFileException
public void get_request_token(java.lang.String callback)
throws SmartFileException
callback - Callback url
SmartFileException
public java.lang.String get_authorization_url()
throws SmartFileException
SmartFileException
public void get_access_token(java.lang.String verifier)
throws SmartFileException
verifier - Verifier obtained at authorization page or to callback
SmartFileException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||