diff --git a/src/main/java/nl/esciencecenter/externalAPIs/BioToolsRestClient.java b/src/main/java/nl/esciencecenter/externalAPIs/BioToolsRestClient.java index 553346a..45751fa 100644 --- a/src/main/java/nl/esciencecenter/externalAPIs/BioToolsRestClient.java +++ b/src/main/java/nl/esciencecenter/externalAPIs/BioToolsRestClient.java @@ -12,7 +12,7 @@ import okhttp3.Response; /** - * The {@code BiotoolsAPI} class provides methods to retrieve and process tool metrics + * The {@code BioToolsRestClient} class provides methods to retrieve and process tool metrics * provided by bio.tools API. */ @Slf4j @@ -34,22 +34,24 @@ public class BioToolsRestClient { * @throws JSONException In case the JSON object returned by bio.tools cannot be * parsed. */ - public static JSONObject fetchToolFromBioTools(String toolID) throws JSONException, IOException { - JSONObject bioToolAnnotation; - toolID = toolID.toLowerCase(); - String urlToBioTools = "https://bio.tools/api/" + toolID + - "?format=json"; - Request request = new Request.Builder().url(urlToBioTools).build(); - Response response = client.newCall(request).execute(); - - if (!response.isSuccessful()) { - throw new IOException("Tool " + toolID + " not found in bio.tools."); - } - - bioToolAnnotation = new JSONObject(response.body().string()); - response.close(); - - log.debug("The list of tools successfully fetched from bio.tools."); - return bioToolAnnotation; - } + public static JSONObject fetchToolFromBioTools(String toolID) throws JSONException, IOException { + JSONObject bioToolAnnotation; + toolID = toolID.toLowerCase(); + String urlToBioTools = "https://bio.tools/api/" + toolID + + "?format=json"; + Request request = new Request.Builder().url(urlToBioTools).build(); + Response response = client.newCall(request).execute(); + + if (!response.isSuccessful()) { + throw new IOException("Tool " + toolID + " not found in bio.tools."); + } + + bioToolAnnotation = new JSONObject(response.body().string()); + response.close(); + + log.debug("The list of tools successfully fetched from bio.tools."); + return bioToolAnnotation; + } + + } diff --git a/src/main/java/nl/esciencecenter/models/benchmarks/WorkflowStepBenchmark.java b/src/main/java/nl/esciencecenter/models/benchmarks/WorkflowStepBenchmark.java index 6375188..ae432da 100644 --- a/src/main/java/nl/esciencecenter/models/benchmarks/WorkflowStepBenchmark.java +++ b/src/main/java/nl/esciencecenter/models/benchmarks/WorkflowStepBenchmark.java @@ -1,17 +1,12 @@ package nl.esciencecenter.models.benchmarks; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; import org.json.JSONObject; -import com.oracle.truffle.regex.tregex.util.json.JsonObject; import lombok.Data; import lombok.NoArgsConstructor; import lombok.NonNull; -import nl.esciencecenter.restape.ToolBenchmarkingAPIs; @Data @NoArgsConstructor