Search in sources :

Example 1 with HttpDownConfigInfo

use of org.pdown.core.entity.HttpDownConfigInfo in project proxyee-down by monkeyWie.

the class AppUtil method fastDownload.

/**
 * 使用pdown-core多连接下载http资源
 */
public static HttpDownBootstrap fastDownload(String url, File file, HttpDownCallback callback) throws IOException {
    HttpDownBootstrap httpDownBootstrap = new URLHttpDownBootstrapBuilder(url, null, null).callback(callback).downConfig(new HttpDownConfigInfo().setFilePath(file.getParent()).setConnections(64)).response(new HttpResponseInfo().setFileName(file.getName())).proxyConfig(PDownConfigContent.getInstance().get().getProxyConfig()).build();
    httpDownBootstrap.start();
    return httpDownBootstrap;
}
Also used : HttpResponseInfo(org.pdown.core.entity.HttpResponseInfo) URLHttpDownBootstrapBuilder(org.pdown.core.boot.URLHttpDownBootstrapBuilder) HttpDownBootstrap(org.pdown.core.boot.HttpDownBootstrap) HttpDownConfigInfo(org.pdown.core.entity.HttpDownConfigInfo)

Aggregations

HttpDownBootstrap (org.pdown.core.boot.HttpDownBootstrap)1 URLHttpDownBootstrapBuilder (org.pdown.core.boot.URLHttpDownBootstrapBuilder)1 HttpDownConfigInfo (org.pdown.core.entity.HttpDownConfigInfo)1 HttpResponseInfo (org.pdown.core.entity.HttpResponseInfo)1