public class ResumableDownloadTask<Requst extends ResumableDownloadRequest,Result extends ResumableDownloadResult>
extends java.lang.Object
implements java.util.concurrent.Callable<Result>
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
checkpointPath |
protected long |
completedPartSize |
protected int |
CPU_SIZE |
protected long |
downloadPartSize |
protected int |
KEEP_ALIVE_TIME |
protected int |
MAX_CORE_POOL_SIZE |
protected int |
MAX_IMUM_POOL_SIZE |
protected int |
MAX_QUEUE_SIZE |
protected java.lang.Exception |
mDownloadException |
protected java.lang.Object |
mLock |
protected long |
mPartExceptionCount |
protected java.util.concurrent.ThreadPoolExecutor |
mPoolExecutor |
protected int |
PART_SIZE_ALIGN_NUM |
protected static java.lang.String |
TEMP_SUFFIX |
| Modifier and Type | Method and Description |
|---|---|
Result |
call() |
protected void |
checkCancel() |
protected void |
checkException() |
protected void |
checkInitData() |
protected boolean |
checkWaitCondition(int partNum) |
protected ResumableDownloadResult |
doMultipartDownload() |
protected void |
notifyMultipartThread() |
protected void |
processException(java.lang.Exception e) |
protected void |
releasePool() |
protected boolean |
removeFile(java.lang.String filePath) |
protected final int CPU_SIZE
protected final int MAX_CORE_POOL_SIZE
protected final int MAX_IMUM_POOL_SIZE
protected final int KEEP_ALIVE_TIME
protected final int PART_SIZE_ALIGN_NUM
protected final int MAX_QUEUE_SIZE
protected static final java.lang.String TEMP_SUFFIX
protected java.util.concurrent.ThreadPoolExecutor mPoolExecutor
protected java.lang.Object mLock
protected java.lang.Exception mDownloadException
protected long completedPartSize
protected long downloadPartSize
protected long mPartExceptionCount
protected java.lang.String checkpointPath
public Result call() throws java.lang.Exception
call in interface java.util.concurrent.Callable<Result extends ResumableDownloadResult>java.lang.Exceptionprotected void checkInitData()
throws ClientException,
ServiceException,
java.io.IOException
ClientExceptionServiceExceptionjava.io.IOExceptionprotected boolean removeFile(java.lang.String filePath)
protected ResumableDownloadResult doMultipartDownload() throws ClientException, ServiceException, java.io.IOException, java.lang.InterruptedException
ClientExceptionServiceExceptionjava.io.IOExceptionjava.lang.InterruptedExceptionprotected void notifyMultipartThread()
protected void processException(java.lang.Exception e)
protected void releasePool()
protected void checkException()
throws java.io.IOException,
ServiceException,
ClientException
java.io.IOExceptionServiceExceptionClientExceptionprotected boolean checkWaitCondition(int partNum)
protected void checkCancel()
throws ClientException
ClientException