@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); } }
@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); } }
@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); } }
@Override public void setUserTag(Object userTag) { if (baseCallBack == null) return; baseCallBack.setUserTag(userTag); }
@Override public Object getUserTag() { if (baseCallBack == null) return null; return baseCallBack.getUserTag(); }