added method getOrganization
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-catalogue/ckan-util-library@141826 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
c99954c9d5
commit
46fc1c8dd9
|
@ -103,6 +103,11 @@ public interface DataCatalogue {
|
|||
* @return
|
||||
*/
|
||||
List<String> getOrganizationsNames();
|
||||
|
||||
/**
|
||||
* Retrieve the organization with this name
|
||||
*/
|
||||
CkanOrganization getOrganizationByName(String name);
|
||||
|
||||
/**
|
||||
* Finds the id associated to the chosen license
|
||||
|
|
|
@ -2512,4 +2512,20 @@ public class DataCatalogueImpl implements DataCatalogue{
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public CkanOrganization getOrganizationByName(String name) {
|
||||
|
||||
checkNotNull(name);
|
||||
|
||||
String ckanName = name.toLowerCase();
|
||||
try{
|
||||
|
||||
return client.getOrganization(ckanName);
|
||||
|
||||
}catch(Exception e){
|
||||
logger.error("Failed to retrieve the organization with name" + name, e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue