Ejemplo n.º 1
0
 @Override
 public void onFailure(HttpException error, String msg) {
   HttpHandler<File> handler = downloadInfo.getHandler();
   if (handler != null) {
     downloadInfo.setState(handler.getState());
   }
   try {
     db.saveOrUpdate(downloadInfo);
   } catch (DbException e) {
     LogUtils.e(e.getMessage(), e);
   }
   if (baseCallBack != null) {
     baseCallBack.onFailure(error, msg);
   }
 }
Ejemplo n.º 2
0
 @Override
 public void onSuccess(ResponseInfo<File> responseInfo) {
   HttpHandler<File> handler = downloadInfo.getHandler();
   if (handler != null) {
     downloadInfo.setState(handler.getState());
   }
   try {
     db.saveOrUpdate(downloadInfo);
   } catch (DbException e) {
     LogUtils.e(e.getMessage(), e);
   }
   if (baseCallBack != null) {
     baseCallBack.onSuccess(responseInfo);
   }
 }
Ejemplo n.º 3
0
 @Override
 public void onLoading(long total, long current, boolean isUploading) {
   HttpHandler<File> handler = downloadInfo.getHandler();
   if (handler != null) {
     downloadInfo.setState(handler.getState());
   }
   downloadInfo.setFileLength(total);
   downloadInfo.setProgress(current);
   try {
     db.saveOrUpdate(downloadInfo);
   } catch (DbException e) {
     LogUtils.e(e.getMessage(), e);
   }
   if (baseCallBack != null) {
     baseCallBack.onLoading(total, current, isUploading);
   }
 }
Ejemplo n.º 4
0
 @Override
 public void setUserTag(Object userTag) {
   if (baseCallBack == null) return;
   baseCallBack.setUserTag(userTag);
 }
Ejemplo n.º 5
0
 @Override
 public Object getUserTag() {
   if (baseCallBack == null) return null;
   return baseCallBack.getUserTag();
 }