public static class BoxRequestDownload.DownloadRequestHandler extends BoxRequest.BoxRequestHandler<BoxRequestDownload>
| Modifier and Type | Field and Description |
|---|---|
protected static int |
DEFAULT_MAX_WAIT_MILLIS |
protected static int |
DEFAULT_NUM_RETRIES |
protected int |
mNumAcceptedRetries |
protected int |
mRetryAfterMillis |
DEFAULT_RATE_LIMIT_WAIT, mNumRateLimitRetries, mRequest, OAUTH_ERROR_HEADER, OAUTH_INVALID_TOKEN, WWW_AUTHENTICATE| Constructor and Description |
|---|
DownloadRequestHandler(BoxRequestDownload request)
Constructs a DownloadRequestHandler with the default parameters.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.io.OutputStream |
getOutputStream(BoxDownload downloadInfo) |
BoxDownload |
onResponse(java.lang.Class clazz,
BoxHttpResponse response)
Parse the response from the server into the expected object T.
|
disconnectForInterrupt, getRetryAfterFromResponse, isResponseSuccess, onException, retryRateLimitedprotected static final int DEFAULT_NUM_RETRIES
protected static final int DEFAULT_MAX_WAIT_MILLIS
protected int mNumAcceptedRetries
protected int mRetryAfterMillis
public DownloadRequestHandler(BoxRequestDownload request)
request - a BoxRequestDownload this handler is responsible for.protected java.io.OutputStream getOutputStream(BoxDownload downloadInfo) throws java.io.FileNotFoundException, java.io.IOException
java.io.FileNotFoundExceptionjava.io.IOExceptionpublic BoxDownload onResponse(java.lang.Class clazz, BoxHttpResponse response) throws java.lang.IllegalAccessException, java.lang.InstantiationException, BoxException
BoxRequest.BoxRequestHandleronResponse in class BoxRequest.BoxRequestHandler<BoxRequestDownload>clazz - the class to use to construct an instance of T in which to parse data to.response - the response from the server.java.lang.IllegalAccessException - thrown if clazz this class does not have access to the constructor for clazz.java.lang.InstantiationException - thrown if clazz cannot be instantiated for example if it does not have a default contsructor.BoxException - thrown for any type of server exception or server response indicating an error.