Moved API

This commit is contained in:
Luca Frosini 2022-06-01 11:04:50 +02:00
parent bceb4acd74
commit 3686d4ed8a
2 changed files with 9 additions and 1 deletions

View File

@ -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);

View File

@ -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();