mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 09:01:08 +03:00
[FIX] Фикс ListDownloader
This commit is contained in:
parent
08f7a98dbb
commit
a9bba37df7
2 changed files with 6 additions and 2 deletions
|
@ -26,7 +26,7 @@ public void download(String base, List<String> applies, Path dstDirFile) throws
|
||||||
|
|
||||||
HttpGet get = null;
|
HttpGet get = null;
|
||||||
for (String apply : applies) {
|
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());
|
LogHelper.debug("Download URL: %s", u.toString());
|
||||||
if (get == null) get = new HttpGet(u);
|
if (get == null) get = new HttpGet(u);
|
||||||
else {
|
else {
|
||||||
|
@ -37,6 +37,10 @@ public void download(String base, List<String> applies, Path dstDirFile) throws
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
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;
|
||||||
|
|
|
@ -207,7 +207,7 @@ public UpdateRequestEvent requestWebSockets() throws Exception {
|
||||||
HashedDir.Diff diff = e.hdir.diff(localDir, matcher);
|
HashedDir.Diff diff = e.hdir.diff(localDir, matcher);
|
||||||
final List<String> adds = new ArrayList<>();
|
final List<String> adds = new ArrayList<>();
|
||||||
diff.mismatch.walk(IOHelper.CROSS_SEPARATOR, (path, name, entry) -> {
|
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();
|
totalSize = diff.mismatch.size();
|
||||||
startTime = Instant.now();
|
startTime = Instant.now();
|
||||||
|
|
Loading…
Reference in a new issue