From 8d44673edbbc613677fa9ad56c9e5e0818e8e4fe Mon Sep 17 00:00:00 2001 From: pcampalani Date: Tue, 5 Sep 2023 12:13:08 +0200 Subject: [PATCH] Fix compilation of JobsApiController class. --- .../openeo/spring/api/JobsApiController.java | 26 +++---------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/src/main/java/org/openeo/spring/api/JobsApiController.java b/src/main/java/org/openeo/spring/api/JobsApiController.java index 793e261..5c62f0d 100644 --- a/src/main/java/org/openeo/spring/api/JobsApiController.java +++ b/src/main/java/org/openeo/spring/api/JobsApiController.java @@ -11,27 +11,13 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStreamWriter; - import java.net.HttpURLConnection; import java.net.URI; import java.net.URISyntaxException; import java.net.URL; -import java.net.URLEncoder; -import java.net.MalformedURLException; - -import java.nio.file.Files; - import java.security.KeyStore; import java.security.Principal; - -import java.time.LocalDateTime; import java.time.OffsetDateTime; -import java.time.ZoneOffset; -import java.time.format.DateTimeFormatter; -import java.time.format.DateTimeFormatterBuilder; -import java.time.format.SignStyle; -import java.time.temporal.ChronoField; - import java.util.Base64; import java.util.HashSet; import java.util.Iterator; @@ -40,17 +26,13 @@ import java.util.Set; import java.util.UUID; -import java.util.stream.Collectors; - import javax.annotation.PostConstruct; +import javax.net.ssl.HostnameVerifier; +import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.KeyManagerFactory; -import javax.net.ssl.TrustManagerFactory; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLSession; -import javax.net.ssl.HttpsURLConnection; - -import javax.net.ssl.HostnameVerifier; - +import javax.net.ssl.TrustManagerFactory; import javax.swing.event.EventListenerList; import javax.validation.Valid; import javax.validation.constraints.Min; @@ -80,7 +62,6 @@ import org.openeo.spring.model.LogEntries; import org.openeo.spring.model.LogEntry; import org.openeo.spring.model.LogEntry.LevelEnum; -import org.openeo.spring.model.LogEntryPath; import org.openeo.wcps.ConvenienceHelper; import org.openeo.wcps.events.JobEvent; import org.openeo.wcps.events.JobEventListener; @@ -624,6 +605,7 @@ public boolean verify(String hostname, SSLSession session) { }); } } else if (responseCode > 399 && responseCode < 600) { + String errorMessage = String.format("Error: %d response from Elastic server.", responseCode); ResponseEntity response = ApiUtil.errorResponse(HttpStatus.INTERNAL_SERVER_ERROR, String.format("An error when accessing logs from elastic stac: %s", errorMessage)); log.error(response.getBody());