Package com.dropbox.core.v2
Class DbxRawClientV2
- java.lang.Object
-
- com.dropbox.core.v2.DbxRawClientV2
-
public abstract class DbxRawClientV2 extends java.lang.ObjectUse 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
HttpRequestorimplementation.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringUSER_AGENT_ID
-
Constructor Summary
Constructors Modifier Constructor Description protectedDbxRawClientV2(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 voidaddAuthHeaders(java.util.List<HttpRequestor.Header> headers)Add the appropriate authentication headers to the request, if any.protected abstract booleancanRefreshAccessToken()<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)DbxHostgetHost()Returns theDbxHostthat was passed in to the constructor.DbxRequestConfiggetRequestConfig()Returns theDbxRequestConfigthat was passed in to the constructor.java.lang.StringgetUserId()Returns theuserIdthat was passed in to the constructor.protected abstract booleanneedsRefreshAccessToken()abstract DbxRefreshResultrefreshAccessToken()<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.UploaderuploadStyle(java.lang.String host, java.lang.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 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
-
canRefreshAccessToken
protected abstract boolean canRefreshAccessToken()
-
needsRefreshAccessToken
protected abstract boolean needsRefreshAccessToken()
-
withPathRoot
protected abstract DbxRawClientV2 withPathRoot(PathRoot pathRoot)
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,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:
DbxWrappedExceptionDbxException
-
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:
DbxWrappedExceptionDbxException
-
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 theDbxRequestConfigthat was passed in to the constructor.- Returns:
- configuration to use for issuing requests.
-
getHost
public DbxHost getHost()
Returns theDbxHostthat was passed in to the constructor.- Returns:
- Dropbox hosts to use for requests.
-
getUserId
public java.lang.String getUserId()
Returns theuserIdthat was passed in to the constructor.- Returns:
- The user ID of the current Dropbox account.
-
-