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;