From e2c0c2a16582dd1ea0421cc89f42784c822c569f Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Wed, 1 Jun 2022 16:38:11 +0200 Subject: [PATCH] Ported change made in master --- src/main/java/org/gcube/gcat/persistence/ckan/CKAN.java | 2 +- .../java/org/gcube/gcat/persistence/ckan/CKANUtility.java | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/gcube/gcat/persistence/ckan/CKAN.java b/src/main/java/org/gcube/gcat/persistence/ckan/CKAN.java index 493b2af..cde72ba 100644 --- a/src/main/java/org/gcube/gcat/persistence/ckan/CKAN.java +++ b/src/main/java/org/gcube/gcat/persistence/ckan/CKAN.java @@ -236,7 +236,7 @@ public abstract class CKAN { protected GXHTTPStringRequest getGXHTTPStringRequest(String path, boolean post) throws UnsupportedEncodingException { - String catalogueURL = CatalogueConfigurationFactory.getInstance().getCkanURL(); + String catalogueURL = CKANUtility.getCkanURL(); GXHTTPStringRequest gxhttpStringRequest = HTTPUtility.createGXHTTPStringRequest(catalogueURL, path, post); gxhttpStringRequest.isExternalCall(true); diff --git a/src/main/java/org/gcube/gcat/persistence/ckan/CKANUtility.java b/src/main/java/org/gcube/gcat/persistence/ckan/CKANUtility.java index d3c6c03..859eec6 100644 --- a/src/main/java/org/gcube/gcat/persistence/ckan/CKANUtility.java +++ b/src/main/java/org/gcube/gcat/persistence/ckan/CKANUtility.java @@ -9,6 +9,14 @@ import org.gcube.gcat.configuration.CatalogueConfigurationFactory; */ public class CKANUtility { + public static String getCkanURL() { + try { + return CatalogueConfigurationFactory.getInstance().getCkanURL(); + } catch(Exception e) { + throw new InternalServerErrorException(e); + } + } + public static String getSysAdminAPI() { try { return CatalogueConfigurationFactory.getInstance().getSysAdminToken();