use of com.kymjs.rxvolley.client.RequestConfig in project yoo_home_Android by culturer.
the class RxVolley method download.
/**
* 下载
*
* @param storeFilePath 本地存储绝对路径
* @param url 要下载的文件的url
* @param progressListener 下载进度回调
* @param callback 回调
*/
public static FileRequest download(String storeFilePath, String url, ProgressListener progressListener, HttpCallback callback) {
RequestConfig config = new RequestConfig();
config.mUrl = url;
config.mRetryPolicy = new DefaultRetryPolicy(DefaultRetryPolicy.DEFAULT_TIMEOUT_MS, 20, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT);
FileRequest request = new FileRequest(storeFilePath, config, callback);
request.setTag(url);
request.setOnProgressListener(progressListener);
new Builder().setRequest(request).doTask();
return request;
}
Aggregations