Search in sources :

Example 1 with RequestConfig

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;
}
Also used : RequestConfig(com.kymjs.rxvolley.client.RequestConfig) FileRequest(com.kymjs.rxvolley.client.FileRequest) DefaultRetryPolicy(com.kymjs.rxvolley.http.DefaultRetryPolicy)

Aggregations

FileRequest (com.kymjs.rxvolley.client.FileRequest)1 RequestConfig (com.kymjs.rxvolley.client.RequestConfig)1 DefaultRetryPolicy (com.kymjs.rxvolley.http.DefaultRetryPolicy)1