Skip to content

Commit

Permalink
fixing throws
Browse files Browse the repository at this point in the history
  • Loading branch information
Idrinth committed May 9, 2021
1 parent fa6a3a2 commit 1b9ae1a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/main/java/de/idrinth/waraddonclient/service/Request.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
import java.io.File;
import java.io.IOException;
import de.idrinth.waraddonclient.model.TrustManager;
import java.security.KeyManagementException;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpGet;

public class Request {

Expand All @@ -18,7 +23,7 @@ public class Request {

private final FileLogger logger;

public Request(TrustManager manager, FileLogger logger) {
public Request(TrustManager manager, FileLogger logger) throws NoSuchAlgorithmException, KeyStoreException, KeyManagementException {
this.logger = logger;
sslContext = org.apache.http.ssl.SSLContextBuilder.create().loadTrustMaterial(
manager.getKeyStore(),
Expand Down Expand Up @@ -73,10 +78,10 @@ public boolean upload(String url, File file) {
}

public String getVersion() {
org.apache.http.client.methods.HttpGet request = new org.apache.http.client.methods.HttpGet("https://api.github.com/repos/Idrinth/WARAddonClient/releases/latest");
org.apache.http.HttpResponse response = executionHandler(request);
String version = "";
try {
HttpGet request = new HttpGet("https://api.github.com/repos/Idrinth/WARAddonClient/releases/latest");
HttpResponse response = executionHandler(request);
if (response != null) {
javax.json.JsonObject data = javax.json.Json.createReader(response.getEntity().getContent()).readObject();
version = data.getString("tag_name");
Expand Down

0 comments on commit 1b9ae1a

Please sign in to comment.