Open source Java client library for use with the NVDB REST API v2
Base URL for the API is https://www.vegvesen.no/nvdb/api/v2
This artifact will be published to jCenter upon releases: http://jcenter.bintray.com/
compile "no.vegvesen.nvdb:nvdbapi-client:1.0.1"
<dependency>
<groupId>no.vegvesen.nvdb</groupId>
<artifactId>nvdb-api-client</artifactId>
<version>1.1.0</version>
</dependency>
Using the client is very simple. All it takes is a couple of lines of code.
This is a completely open API. It has no authentication nor any authorization. We strongly encourage using the X-Client-Name header because it helps us gather statistics which we use to improve the API.
To start using the library simply instantiate the factory. It takes three arguments:
- Base URL for the API
- Value for request header User-Agent
- Value for request header X-Client-Name
// First, create factory
ClientFactory factory = new ClientFactory("https://www.vegvesen.no/nvdb/api/v2", "nvdbapi-client", "ACME");
// Then, create your client. Typically, there's one per root endpoint
RoadObjectClient client = factory.createRoadObjectClient();
// Example single object download
RoadObject ro = client.getRoadObject(534, 1);
// Remember to close your factory when you're done using it
factory.close();
The repo contains the Gradle wrapper. The client is built running:
// Simple compilation
./gradlew build
// Publish to your Maven local
./gradlew publishToMavenLocal