mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 09:01:08 +03:00
[FIX] Замена велосипеда на urlEncode
This commit is contained in:
parent
da615fb11b
commit
5e7230de21
1 changed files with 1 additions and 6 deletions
|
@ -48,7 +48,7 @@ public void download(String base, List<DownloadTask> applies, Path dstDirFile, D
|
||||||
|
|
||||||
HttpGet get = null;
|
HttpGet get = null;
|
||||||
for (DownloadTask apply : applies) {
|
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);
|
callback.stateChanged(apply.apply,0L, apply.size);
|
||||||
LogHelper.debug("Download URL: %s", u.toString());
|
LogHelper.debug("Download URL: %s", u.toString());
|
||||||
if (get == null) get = new HttpGet(u);
|
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> {
|
static class FileDownloadResponseHandler implements ResponseHandler<Path> {
|
||||||
private final Path target;
|
private final Path target;
|
||||||
private final DownloadTask task;
|
private final DownloadTask task;
|
||||||
|
|
Loading…
Reference in a new issue