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 21d57482..6bda4b15 100644 --- a/LauncherAPI/src/main/java/ru/gravit/launcher/downloader/ListDownloader.java +++ b/LauncherAPI/src/main/java/ru/gravit/launcher/downloader/ListDownloader.java @@ -26,7 +26,7 @@ public void download(String base, List applies, Path dstDirFile) throws HttpGet get = null; for (String apply : applies) { - URI u = new URL(base.concat(apply)).toURI(); + URI u = new URL(base.concat(escapeURL(apply))).toURI(); LogHelper.debug("Download URL: %s", u.toString()); if (get == null) get = new HttpGet(u); else { @@ -37,6 +37,10 @@ public void download(String base, List applies, Path dstDirFile) throws } } } + public String escapeURL(String apply) + { + return apply.replaceAll(" ", "%20"); + } static class FileDownloadResponseHandler implements ResponseHandler { private final Path target; diff --git a/LauncherAPI/src/main/java/ru/gravit/launcher/request/update/UpdateRequest.java b/LauncherAPI/src/main/java/ru/gravit/launcher/request/update/UpdateRequest.java index 3158e8f8..03812156 100644 --- a/LauncherAPI/src/main/java/ru/gravit/launcher/request/update/UpdateRequest.java +++ b/LauncherAPI/src/main/java/ru/gravit/launcher/request/update/UpdateRequest.java @@ -207,7 +207,7 @@ public UpdateRequestEvent requestWebSockets() throws Exception { HashedDir.Diff diff = e.hdir.diff(localDir, matcher); final List adds = new ArrayList<>(); diff.mismatch.walk(IOHelper.CROSS_SEPARATOR, (path, name, entry) -> { - if(entry.getType() == HashedEntry.Type.FILE) adds.add(path.replaceAll(" ","%20")); + if(entry.getType() == HashedEntry.Type.FILE) adds.add(path); }); totalSize = diff.mismatch.size(); startTime = Instant.now();