public DownloadTask resume(String taskId){
  DownloadTask downloadTask=getCurrentTaskById(taskId);
  if (downloadTask != null) {
    if (downloadTask.getDownloadStatus() != DownloadStatus.DOWNLOAD_STATUS_COMPLETED) {
      downloadTask.setDownloadStatus(DownloadStatus.DOWNLOAD_STATUS_PREPARE);
      downloadTask.setdownFileStore(downFileStore);
      downloadTask.setHttpClient(client);
      Future future=executorService.submit(downloadTask);
      futureMap.put(downloadTask.getId(),future);
    }
  }
 else {
    downloadTask=getDBTaskById(taskId);
    if (downloadTask != null) {
      currentTaskList.put(taskId,downloadTask);
      downloadTask.setDownloadStatus(DownloadStatus.DOWNLOAD_STATUS_PREPARE);
      downloadTask.setdownFileStore(downFileStore);
      downloadTask.setHttpClient(client);
      Future future=executorService.submit(downloadTask);
      futureMap.put(downloadTask.getId(),future);
    }
  }
  return downloadTask;
}

public DownloadTask resume ( String taskId ) { DownloadTask downloadTask = getCurrentTaskById ( taskId ) ; if ( downloadTask != null ) { if ( downloadTask . getDownloadStatus ( ) != DownloadStatus . DOWNLOAD_STATUS_COMPLETED ) { downloadTask . setDownloadStatus ( DownloadStatus . DOWNLOAD_STATUS_PREPARE ) ; downloadTask . setdownFileStore ( downFileStore ) ; downloadTask . setHttpClient ( client ) ; Future future = executorService . submit ( downloadTask ) ; futureMap . put ( downloadTask . getId ( ) , future ) ; } } else { downloadTask = getDBTaskById ( taskId ) ; if ( downloadTask != null ) { currentTaskList . put ( taskId , downloadTask ) ; downloadTask . setDownloadStatus ( DownloadStatus . DOWNLOAD_STATUS_PREPARE ) ; downloadTask . setdownFileStore ( downFileStore ) ; downloadTask . setHttpClient ( client ) ; Future future = executorService . submit ( downloadTask ) ; futureMap . put ( downloadTask . getId ( ) , future ) ; } } return downloadTask ; }
if return null , the task does not exist
