gcat/src/main/java/org/gcube/gcat/persistence/ckan/CKANUtility.java

28 lines
570 B
Java
Raw Normal View History

package org.gcube.gcat.persistence.ckan;
import javax.ws.rs.InternalServerErrorException;
/**
* @author Luca Frosini (ISTI - CNR)
*/
public class CKANUtility {
public static String getSysAdminAPI() {
try {
return CKANInstance.getInstance().getSysAdminToken();
} catch(Exception e) {
throw new InternalServerErrorException(e);
}
}
public static String getApiKey() {
try {
2019-09-16 12:00:49 +02:00
CKANUser ckanUser = CKANUserCache.getCurrrentCKANUser();
return ckanUser.getApiKey();
2019-09-16 14:48:18 +02:00
} catch(Exception e) {
throw new InternalServerErrorException(e);
}
}
}