|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.dropbox.client2.session.AbstractSession
public abstract class AbstractSession
Keeps track of a logged in user and contains configuration options for the
DropboxAPI. This is a base class to use for creating your own
Sessions.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.dropbox.client2.session.Session |
|---|
Session.AccessType, Session.ProxyInfo |
| Constructor Summary | |
|---|---|
AbstractSession(AppKeyPair appKeyPair,
Session.AccessType type)
Creates a new session with the given app key and secret, and access type. |
|
AbstractSession(AppKeyPair appKeyPair,
Session.AccessType type,
AccessTokenPair accessTokenPair)
Creates a new session with the given app key and secret, and access type. |
|
| Method Summary | |
|---|---|
AccessTokenPair |
getAccessTokenPair()
Returns the currently logged in user's access token and secret. |
Session.AccessType |
getAccessType()
Returns what Dropbox access type to use (currently app folder or entire Dropbox). |
String |
getAPIServer()
Returns the Dropbox API server. |
AppKeyPair |
getAppKeyPair()
Returns the app key and secret. |
String |
getContentServer()
Returns the Dropbox content server. |
org.apache.http.client.HttpClient |
getHttpClient()
Will be called every time a request is made to Dropbox, in case you want to use a new client every time. |
Locale |
getLocale()
Returns the locale to use. |
Session.ProxyInfo |
getProxyInfo()
Will be called every time a request is made to Dropbox, in case the proxy changes between requests. |
String |
getWebServer()
Returns the Dropbox web server. |
boolean |
isLinked()
Returns whether or not this session has a user's access token and secret. |
void |
setAccessTokenPair(AccessTokenPair accessTokenPair)
Links the session with the given access token and secret. |
void |
setRequestTimeout(org.apache.http.client.methods.HttpUriRequest request)
Will be called every time right before a request is sent to Dropbox. |
void |
sign(org.apache.http.HttpRequest request)
Signs the request by using's OAuth's HTTP header authorization scheme and the PLAINTEXT signature method. |
void |
unlink()
Unlinks the session by removing any stored access token and secret. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractSession(AppKeyPair appKeyPair,
Session.AccessType type)
public AbstractSession(AppKeyPair appKeyPair,
Session.AccessType type,
AccessTokenPair accessTokenPair)
| Method Detail |
|---|
public void setAccessTokenPair(AccessTokenPair accessTokenPair)
public AppKeyPair getAppKeyPair()
Session
getAppKeyPair in interface Sessionpublic AccessTokenPair getAccessTokenPair()
Session
getAccessTokenPair in interface Sessionpublic Session.AccessType getAccessType()
Session
getAccessType in interface Sessionpublic Locale getLocale()
Locale.ENLISH, but you
are highly encouraged to localize your application and return the system
locale instead. Note: as of the time this was written, Dropbox supports
the de, en, es, fr, and ja locales - if you use a locale other than
these, messages will be returned in English. However, it is good
practice to pass along the correct locale as we will add more languages
in the future.
getLocale in interface Sessionpublic boolean isLinked()
Session
isLinked in interface Sessionpublic void unlink()
Session
unlink in interface Sessionpublic void sign(org.apache.http.HttpRequest request)
sign in interface Sessionrequest - an HttpRequest.Session.sign(org.apache.http.HttpRequest)public Session.ProxyInfo getProxyInfo()
Session.ProxyInfo object with a host and optionally a
port set.
getProxyInfo in interface Sessionpublic org.apache.http.client.HttpClient getHttpClient()
getHttpClient in interface Sessionpublic void setRequestTimeout(org.apache.http.client.methods.HttpUriRequest request)
setRequestTimeout in interface Sessionpublic String getAPIServer()
Session
getAPIServer in interface Sessionpublic String getContentServer()
Session
getContentServer in interface Sessionpublic String getWebServer()
Session
getWebServer in interface Session
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||