Package com.dropbox.core.v2
Class DbxRawClientV2
java.lang.Object
com.dropbox.core.v2.DbxRawClientV2
Use this class to make remote calls to the Dropbox API. You'll need an access token first,
normally acquired via
DbxWebAuth.
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 -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDbxRawClientV2(DbxRequestConfig requestConfig, DbxHost host, String userId, PathRoot pathRoot) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidaddAuthHeaders(List<HttpRequestor.Header> headers) Add the appropriate authentication headers to the request, if any.protected abstract boolean<ArgT,ResT, ErrT>
DbxDownloader<ResT> downloadStyle(String host, String path, ArgT arg, boolean noAuth, List<HttpRequestor.Header> extraHeaders, StoneSerializer<ArgT> argSerializer, StoneSerializer<ResT> responseSerializer, StoneSerializer<ErrT> errorSerializer) getHost()Returns theDbxHostthat was passed in to the constructor.Returns theDbxRequestConfigthat was passed in to the constructor.Returns theuserIdthat was passed in to the constructor.protected abstract booleanabstract DbxRefreshResult<ArgT,ResT, ErrT>
ResTrpcStyle(String host, String path, ArgT arg, boolean noAuth, StoneSerializer<ArgT> argSerializer, StoneSerializer<ResT> responseSerializer, StoneSerializer<ErrT> errorSerializer) <ArgT> HttpRequestor.UploaderuploadStyle(String host, String path, ArgT arg, boolean noAuth, StoneSerializer<ArgT> argSerializer) protected abstract DbxRawClientV2withPathRoot(PathRoot pathRoot) Clone a new DbxRawClientV2 with Dropbox-API-Path-Root header.
-
Field Details
-
USER_AGENT_ID
- See Also:
-
-
Constructor Details
-
DbxRawClientV2
protected DbxRawClientV2(DbxRequestConfig requestConfig, DbxHost host, 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 Details
-
addAuthHeaders
Add the appropriate authentication headers to the request, if any.- Parameters:
headers- List of request headers. Add authentication headers to this list.
-
refreshAccessToken
- Throws:
DbxException
-
canRefreshAccessToken
protected abstract boolean canRefreshAccessToken() -
needsRefreshAccessToken
protected abstract boolean needsRefreshAccessToken() -
withPathRoot
Clone a new DbxRawClientV2 with Dropbox-API-Path-Root header.- Parameters:
pathRoot-pathRootobject containing the content for Dropbox-API-Path-Root header.
-
rpcStyle
public <ArgT,ResT, ResT rpcStyleErrT> (String host, String path, ArgT arg, boolean noAuth, StoneSerializer<ArgT> argSerializer, StoneSerializer<ResT> responseSerializer, StoneSerializer<ErrT> errorSerializer) throws DbxWrappedException, DbxException - Throws:
DbxWrappedExceptionDbxException
-
downloadStyle
public <ArgT,ResT, DbxDownloader<ResT> downloadStyleErrT> (String host, String path, ArgT arg, boolean noAuth, List<HttpRequestor.Header> extraHeaders, StoneSerializer<ArgT> argSerializer, StoneSerializer<ResT> responseSerializer, StoneSerializer<ErrT> errorSerializer) throws DbxWrappedException, DbxException - Throws:
DbxWrappedExceptionDbxException
-
uploadStyle
public <ArgT> HttpRequestor.Uploader uploadStyle(String host, String path, ArgT arg, boolean noAuth, StoneSerializer<ArgT> argSerializer) throws DbxException - Throws:
DbxException
-
getRequestConfig
Returns theDbxRequestConfigthat was passed in to the constructor.- Returns:
- configuration to use for issuing requests.
-
getHost
Returns theDbxHostthat was passed in to the constructor.- Returns:
- Dropbox hosts to use for requests.
-
getUserId
Returns theuserIdthat was passed in to the constructor.- Returns:
- The user ID of the current Dropbox account.
-