public class SharedLinkAPIConnection extends BoxAPIConnection
BoxAPIConnection.ResourceLinkType
DEFAULT_MAX_ATTEMPTS, DEFAULT_MAX_RETRIES
Modifier and Type | Method and Description |
---|---|
boolean |
canRefresh()
Determines if this connection's access token can be refreshed.
|
String |
getAccessToken()
Gets an access token that can be used to authenticate an API request.
|
boolean |
getAutoRefresh()
Gets whether or not automatic refreshing of this connection's access token is enabled.
|
String |
getBaseUploadURL()
Gets the base upload URL that's used when performing file uploads to Box.
|
String |
getBaseURL()
Gets the base URL that's used when sending requests to the Box API.
|
long |
getExpires()
Gets the amount of time for which this connection's access token is valid.
|
int |
getMaxRequestAttempts()
Deprecated.
getMaxRetryAttempts is preferred because it more clearly gets the number
of times a request should be retried after an error response is received.
|
int |
getMaxRetryAttempts()
Gets the maximum number of times an API request will be retried after an error response
is received.
|
String |
getRefreshToken()
Gets a refresh token that can be used to refresh an access token.
|
String |
getUserAgent()
Gets the user agent that's used when sending requests to the Box API.
|
boolean |
needsRefresh()
Determines if this connection's access token has expired and needs to be refreshed.
|
void |
refresh()
Refresh's this connection's access token using its refresh token.
|
void |
setAccessToken(String accessToken)
Sets the access token to use when authenticating API requests.
|
void |
setAutoRefresh(boolean autoRefresh)
Enables or disables automatic refreshing of this connection's access token.
|
void |
setBaseUploadURL(String baseUploadURL)
Sets the base upload URL to be used when performing file uploads to Box.
|
void |
setBaseURL(String baseURL)
Sets the base URL to be used when sending requests to the Box API.
|
void |
setExpires(long milliseconds)
Sets the amount of time for which this connection's access token is valid before it must be refreshed.
|
void |
setMaxRequestAttempts(int attempts)
Deprecated.
setMaxRetryAttempts is preferred because it more clearly sets the number
of times a request should be retried after an error response is received.
|
void |
setMaxRetryAttempts(int attempts)
Sets the maximum number of times an API request will be retried after an error response
is received.
|
void |
setRefreshToken(String refreshToken)
Sets the refresh token to use when refreshing an access token.
|
void |
setUserAgent(String userAgent)
Sets the user agent to be used when sending requests to the Box API.
|
addListener, asSelf, asUser, authenticate, determineResourceLinkType, enableNotifications, getAuthorizationURL, getBaseAppUrl, getClientID, getClientSecret, getConnectTimeout, getLastRefresh, getLowerScopedToken, getProxy, getProxyPassword, getProxyUsername, getReadTimeout, getRefreshLock, getRequestInterceptor, getRevokeURL, getTokenURL, notifyError, notifyRefresh, removeCustomHeader, removeListener, restore, restore, revokeToken, save, setBaseAppUrl, setConnectTimeout, setCustomHeader, setLastRefresh, setProxy, setProxyPassword, setProxyUsername, setReadTimeout, setRequestInterceptor, setRevokeURL, setTokenURL, suppressNotifications
public long getExpires()
BoxAPIConnection
getExpires
in class BoxAPIConnection
public void setExpires(long milliseconds)
BoxAPIConnection
setExpires
in class BoxAPIConnection
milliseconds
- the number of milliseconds for which the access token is valid.public String getBaseURL()
BoxAPIConnection
getBaseURL
in class BoxAPIConnection
public void setBaseURL(String baseURL)
BoxAPIConnection
setBaseURL
in class BoxAPIConnection
baseURL
- a base URLpublic String getBaseUploadURL()
BoxAPIConnection
getBaseUploadURL
in class BoxAPIConnection
public void setBaseUploadURL(String baseUploadURL)
BoxAPIConnection
setBaseUploadURL
in class BoxAPIConnection
baseUploadURL
- a base upload URL.public String getUserAgent()
BoxAPIConnection
getUserAgent
in class BoxAPIConnection
public void setUserAgent(String userAgent)
BoxAPIConnection
setUserAgent
in class BoxAPIConnection
userAgent
- the user agent.public String getAccessToken()
BoxAPIConnection
getAccessToken()
.getAccessToken
in class BoxAPIConnection
public void setAccessToken(String accessToken)
BoxAPIConnection
setAccessToken
in class BoxAPIConnection
accessToken
- a valid access token to use when authenticating API requests.public String getRefreshToken()
BoxAPIConnection
getRefreshToken
in class BoxAPIConnection
public void setRefreshToken(String refreshToken)
BoxAPIConnection
setRefreshToken
in class BoxAPIConnection
refreshToken
- a valid refresh token.public void setAutoRefresh(boolean autoRefresh)
BoxAPIConnection
setAutoRefresh
in class BoxAPIConnection
autoRefresh
- true to enable auto token refresh; otherwise false.public boolean getAutoRefresh()
BoxAPIConnection
getAutoRefresh
in class BoxAPIConnection
@Deprecated public int getMaxRequestAttempts()
getMaxRequestAttempts
in class BoxAPIConnection
@Deprecated public void setMaxRequestAttempts(int attempts)
setMaxRequestAttempts
in class BoxAPIConnection
attempts
- the maximum number of request attempts.public int getMaxRetryAttempts()
getMaxRetryAttempts
in class BoxAPIConnection
public void setMaxRetryAttempts(int attempts)
setMaxRetryAttempts
in class BoxAPIConnection
attempts
- the maximum number of request attempts.public boolean canRefresh()
BoxAPIConnection
canRefresh
in class BoxAPIConnection
public boolean needsRefresh()
BoxAPIConnection
needsRefresh
in class BoxAPIConnection
public void refresh()
BoxAPIConnection
refresh
in class BoxAPIConnection