mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 00:51:01 +03:00
[FIX] Фикс LauncherRequest
This commit is contained in:
parent
558ad30e24
commit
7b695e77ad
2 changed files with 9 additions and 11 deletions
|
@ -38,21 +38,17 @@ public void download(String base, List<String> applies, Path dstDirFile) throws
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void downloadOne(String url, Path target) throws IOException, URISyntaxException
|
public void downloadOne(String url, Path target) throws IOException, URISyntaxException
|
||||||
{
|
{
|
||||||
try (CloseableHttpClient httpclient = HttpClients.custom()
|
try (CloseableHttpClient httpclient = HttpClients.custom()
|
||||||
.setRedirectStrategy(new LaxRedirectStrategy())
|
.setRedirectStrategy(new LaxRedirectStrategy())
|
||||||
.build()) {
|
.build()) {
|
||||||
|
|
||||||
HttpGet get = null;
|
HttpGet get;
|
||||||
URI u = new URL(url).toURI();
|
URI u = new URL(url).toURI();
|
||||||
LogHelper.debug("Download URL: %s", u.toString());
|
LogHelper.debug("Download URL: %s", u.toString());
|
||||||
if (get == null) get = new HttpGet(u);
|
get = new HttpGet(u);
|
||||||
else {
|
httpclient.execute(get, new FileDownloadResponseHandler(target.toAbsolutePath()));
|
||||||
get.reset();
|
|
||||||
get.setURI(u);
|
|
||||||
}
|
|
||||||
httpclient.execute(get, new FileDownloadResponseHandler(target));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,9 +56,11 @@ public static void update(LauncherConfig config, LauncherRequestEvent result) th
|
||||||
IOHelper.transfer(BINARY_PATH, stream);
|
IOHelper.transfer(BINARY_PATH, stream);
|
||||||
}*/
|
}*/
|
||||||
try {
|
try {
|
||||||
ListDownloader.downloadOne(result.url, BINARY_PATH);
|
ListDownloader downloader = new ListDownloader();
|
||||||
} catch (URISyntaxException e) {
|
downloader.downloadOne(result.url, BINARY_PATH);
|
||||||
throw new SecurityException(e);
|
} catch(Throwable e)
|
||||||
|
{
|
||||||
|
LogHelper.error(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
builder.start();
|
builder.start();
|
||||||
|
|
Loading…
Reference in a new issue