summaryrefslogtreecommitdiffstats
path: root/dozentenmodul/src/main/java/org/openslx/dozmod/util/ClientVersion.java
diff options
context:
space:
mode:
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/util/ClientVersion.java')
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/util/ClientVersion.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/util/ClientVersion.java b/dozentenmodul/src/main/java/org/openslx/dozmod/util/ClientVersion.java
index 8426282b..7827ac72 100644
--- a/dozentenmodul/src/main/java/org/openslx/dozmod/util/ClientVersion.java
+++ b/dozentenmodul/src/main/java/org/openslx/dozmod/util/ClientVersion.java
@@ -3,13 +3,13 @@ package org.openslx.dozmod.util;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
-import java.io.InputStream;
import java.io.InputStreamReader;
-import java.net.URL;
import java.nio.charset.StandardCharsets;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.output.ByteArrayOutputStream;
+import org.apache.hc.client5.http.classic.methods.HttpGet;
+import org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.openslx.dozmod.App;
@@ -117,9 +117,10 @@ public class ClientVersion {
public void run() {
App.waitForInit();
String json = null;
- try (InputStream reader = new URL(urlString).openStream()) {
+ HttpGet get = new HttpGet(urlString);
+ try (CloseableHttpResponse resp = ProxyConfigurator.getClient().execute(get)) {
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
- buffer.write(reader);
+ buffer.write(resp.getEntity().getContent());
buffer.close();
json = new String(buffer.toByteArray(), StandardCharsets.UTF_8);
} catch (Exception e) {