Package com.dropbox.core.v2
Class DbxRawClientV2
- java.lang.Object
-
- com.dropbox.core.v2.DbxRawClientV2
-
public abstract class DbxRawClientV2 extends java.lang.Object
Use this class to make remote calls to the Dropbox API. You'll need an access token first, normally acquired viaDbxWebAuth
.This class has no mutable state, so it's thread safe as long as you pass in a thread safe
HttpRequestor
implementation.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
USER_AGENT_ID
-
Constructor Summary
Constructors Modifier Constructor Description protected
DbxRawClientV2(DbxRequestConfig requestConfig, DbxHost host, java.lang.String userId, PathRoot pathRoot)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
addAuthHeaders(java.util.List<HttpRequestor.Header> headers)
Add the appropriate authentication headers to the request, if any.<ArgT,ResT,ErrT>
DbxDownloader<ResT>downloadStyle(java.lang.String host, java.lang.String path, ArgT arg, boolean noAuth, java.util.List<HttpRequestor.Header> extraHeaders, StoneSerializer<ArgT> argSerializer, StoneSerializer<ResT> responseSerializer, StoneSerializer<ErrT> errorSerializer)
DbxHost
getHost()
Returns theDbxHost
that was passed in to the constructor.DbxRequestConfig
getRequestConfig()
Returns theDbxRequestConfig
that was passed in to the constructor.java.lang.String
getUserId()
Returns theuserId
that was passed in to the constructor.abstract DbxRefreshResult
refreshAccessToken()
<ArgT,ResT,ErrT>
ResTrpcStyle(java.lang.String host, java.lang.String path, ArgT arg, boolean noAuth, StoneSerializer<ArgT> argSerializer, StoneSerializer<ResT> responseSerializer, StoneSerializer<ErrT> errorSerializer)
<ArgT> HttpRequestor.Uploader
uploadStyle(java.lang.String host, java.lang.String path, ArgT arg, boolean noAuth, StoneSerializer<ArgT> argSerializer)
protected abstract DbxRawClientV2
withPathRoot(PathRoot pathRoot)
Clone a new DbxRawClientV2 with Dropbox-API-Path-Root header.
-
-
-
Field Detail
-
USER_AGENT_ID
public static final java.lang.String USER_AGENT_ID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DbxRawClientV2
protected DbxRawClientV2(DbxRequestConfig requestConfig, DbxHost host, java.lang.String userId, PathRoot pathRoot)
- Parameters:
requestConfig
- Configuration controlling How requests should be issued to Dropbox servers.host
- Dropbox server hostnames (primarily for internal use)userId
- The user ID of the current Dropbox account. Used for multi-Dropbox account use-case.pathRoot
- We will send this value in Dropbox-API-Path-Root header if it presents.
-
-
Method Detail
-
addAuthHeaders
protected abstract void addAuthHeaders(java.util.List<HttpRequestor.Header> headers)
Add the appropriate authentication headers to the request, if any.- Parameters:
headers
- List of request headers. Add authentication headers to this list.
-
refreshAccessToken
public abstract DbxRefreshResult refreshAccessToken() throws DbxException
- Throws:
DbxException
-
withPathRoot
protected abstract DbxRawClientV2 withPathRoot(PathRoot pathRoot)
Clone a new DbxRawClientV2 with Dropbox-API-Path-Root header.- Parameters:
pathRoot
-pathRoot
object containing the content for Dropbox-API-Path-Root header.
-
rpcStyle
public <ArgT,ResT,ErrT> ResT rpcStyle(java.lang.String host, java.lang.String path, ArgT arg, boolean noAuth, StoneSerializer<ArgT> argSerializer, StoneSerializer<ResT> responseSerializer, StoneSerializer<ErrT> errorSerializer) throws DbxWrappedException, DbxException
- Throws:
DbxWrappedException
DbxException
-
downloadStyle
public <ArgT,ResT,ErrT> DbxDownloader<ResT> downloadStyle(java.lang.String host, java.lang.String path, ArgT arg, boolean noAuth, java.util.List<HttpRequestor.Header> extraHeaders, StoneSerializer<ArgT> argSerializer, StoneSerializer<ResT> responseSerializer, StoneSerializer<ErrT> errorSerializer) throws DbxWrappedException, DbxException
- Throws:
DbxWrappedException
DbxException
-
uploadStyle
public <ArgT> HttpRequestor.Uploader uploadStyle(java.lang.String host, java.lang.String path, ArgT arg, boolean noAuth, StoneSerializer<ArgT> argSerializer) throws DbxException
- Throws:
DbxException
-
getRequestConfig
public DbxRequestConfig getRequestConfig()
Returns theDbxRequestConfig
that was passed in to the constructor.- Returns:
- configuration to use for issuing requests.
-
getHost
public DbxHost getHost()
Returns theDbxHost
that was passed in to the constructor.- Returns:
- Dropbox hosts to use for requests.
-
getUserId
public java.lang.String getUserId()
Returns theuserId
that was passed in to the constructor.- Returns:
- The user ID of the current Dropbox account.
-
-