From 5e7230de21f9dd5a340a03fba46d21c2aa26e49e Mon Sep 17 00:00:00 2001 From: Gravit Date: Sat, 13 Apr 2019 21:05:41 +0700 Subject: [PATCH] =?UTF-8?q?[FIX]=20=D0=97=D0=B0=D0=BC=D0=B5=D0=BD=D0=B0=20?= =?UTF-8?q?=D0=B2=D0=B5=D0=BB=D0=BE=D1=81=D0=B8=D0=BF=D0=B5=D0=B4=D0=B0=20?= =?UTF-8?q?=D0=BD=D0=B0=20urlEncode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/ru/gravit/launcher/downloader/ListDownloader.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/LauncherAPI/src/main/java/ru/gravit/launcher/downloader/ListDownloader.java b/LauncherAPI/src/main/java/ru/gravit/launcher/downloader/ListDownloader.java index 647db1e5..0a89d2f4 100644 --- a/LauncherAPI/src/main/java/ru/gravit/launcher/downloader/ListDownloader.java +++ b/LauncherAPI/src/main/java/ru/gravit/launcher/downloader/ListDownloader.java @@ -48,7 +48,7 @@ public void download(String base, List 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 { private final Path target; private final DownloadTask task;