コード例 #1
0
 public void removeDownload(DownloadInfo downloadInfo) throws DbException {
   HttpHandler<File> handler = downloadInfo.getHandler();
   if (handler != null && !handler.isCancelled()) {
     handler.cancel();
   }
   downloadInfoList.remove(downloadInfo);
   db.delete(downloadInfo);
 }
コード例 #2
0
 public void stopDownload(DownloadInfo downloadInfo) throws DbException {
   HttpHandler<File> handler = downloadInfo.getHandler();
   if (handler != null && !handler.isCancelled()) {
     handler.cancel();
   } else {
     downloadInfo.setState(HttpHandler.State.CANCELLED);
   }
   db.saveOrUpdate(downloadInfo);
 }