[FIX] Замена велосипеда на urlEncode

This commit is contained in:
Gravit 2019-04-13 21:05:41 +07:00
parent da615fb11b
commit 5e7230de21
No known key found for this signature in database
GPG key ID: 061981E1E85D3216

View file

@ -48,7 +48,7 @@ public void download(String base, List<DownloadTask> applies, Path dstDirFile, D
HttpGet get = null;
for (DownloadTask apply : applies) {
URI u = new URL(base.concat(escapeURL(apply.apply))).toURI();
URI u = new URL(base.concat(IOHelper.urlEncode(apply.apply))).toURI();
callback.stateChanged(apply.apply,0L, apply.size);
LogHelper.debug("Download URL: %s", u.toString());
if (get == null) get = new HttpGet(u);
@ -75,11 +75,6 @@ public void downloadOne(String url, Path target) throws IOException, URISyntaxEx
}
}
public String escapeURL(String apply)
{
return apply.replaceAll(" ", "%20");
}
static class FileDownloadResponseHandler implements ResponseHandler<Path> {
private final Path target;
private final DownloadTask task;