Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

kvs-rest-clients

This module contains GBIF REST clients to access GBIF API resources. All clients are implemented using Feign and Jackson. This is a java 11 library.

To create an instance of a Rest client, a ClientConfiguration is required, for example:

ClientConfiguration clientConfiguration = ClientConfiguration.builder()
                                            .withBaseApiUrl("http://api.gbif.org/v1")
                                            .withTimeOut(60000L)
                                            .withFileCacheMaxSizeMb(128L)
                                            .build();

GeocodeService geocodeService = RestClientFactory.createGeocodeService(clientConfiguration);

Clients can also be created using the gbif-common-ws module, for example:

NameUsageMatchingService nameUsageMatchingService = new org.gbif.ws.client.ClientBuilder()
        .withUrl("http://api.gbif.org/v1")
        .withObjectMapper(JacksonJsonObjectMapperProvider.getObjectMapperWithBuilderSupport())
        .withFormEncoder()
        .build(NameUsageMatchingService.class);

Build

To build, install and run tests, execute the Maven command:

mvn clean package install -U