diff --git a/src/main/java/de/svenkubiak/jpushover/apis/OpenClient.java b/src/main/java/de/svenkubiak/jpushover/apis/OpenClient.java index 053cee3..7eea694 100644 --- a/src/main/java/de/svenkubiak/jpushover/apis/OpenClient.java +++ b/src/main/java/de/svenkubiak/jpushover/apis/OpenClient.java @@ -43,18 +43,18 @@ public class OpenClient { StringBuilder params = new StringBuilder() .append("email") - .append("=") + .append('=') .append(email) - .append("&") + .append('&') .append("password") - .append("=") + .append('=') .append(password); if (twoFactor != null) { params - .append("&") + .append('&') .append("twofa") - .append("=") + .append('=') .append(twoFactor); } @@ -72,6 +72,7 @@ public class OpenClient { .response(response.body()) .isSuccessful((response.statusCode() == 200) ? true : false); } catch (IOException | InterruptedException e) { + Thread.currentThread().interrupt(); throw new JPushoverException("Pushover Login failed", e); } @@ -124,6 +125,7 @@ public class OpenClient { HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); messages = response.body(); } catch (IOException | InterruptedException e) { + Thread.currentThread().interrupt(); throw new JPushoverException("Failed to get messages", e); } @@ -169,6 +171,7 @@ public class OpenClient { .response(response.body()) .isSuccessful((response.statusCode() == 200) ? true : false); } catch (IOException | InterruptedException e) { + Thread.currentThread().interrupt(); throw new JPushoverException("Failed to delete messages", e); } @@ -242,6 +245,7 @@ public class OpenClient { .response(response.body()) .isSuccessful(true); } catch (IOException | InterruptedException e) { + Thread.currentThread().interrupt(); throw new JPushoverException("Failed to register new device", e); } diff --git a/src/main/java/de/svenkubiak/jpushover/http/PushoverRequest.java b/src/main/java/de/svenkubiak/jpushover/http/PushoverRequest.java index 82505ab..6258e20 100644 --- a/src/main/java/de/svenkubiak/jpushover/http/PushoverRequest.java +++ b/src/main/java/de/svenkubiak/jpushover/http/PushoverRequest.java @@ -59,6 +59,7 @@ public class PushoverRequest { try { return httpClientBuilder.build().send(httpRequest, HttpResponse.BodyHandlers.ofString()); } catch (IOException | InterruptedException e) { + Thread.currentThread().interrupt(); throw new JPushoverException("Failed to execute HTTP request", e); } }