Skip to content
BSD-licensed open source Java library for consuming NVDB REST API
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
gradle
src
.gitignore
.travis.yml
Jenkinsfile
LICENSE
README.md
build.gradle
gradle.properties
gradlew
gradlew.bat

README.md

Build Status

nvdb-api-client

Open source Java client library for use with the NVDB REST API v2

API URL

Base URL for the API is https://www.vegvesen.no/nvdb/api/v2

Artifact

This artifact will be published to jCenter upon releases: http://jcenter.bintray.com/

Gradle

compile "no.vegvesen.nvdb:nvdbapi-client:1.0.1"

Maven

<dependency>
    <groupId>no.vegvesen.nvdb</groupId>
    <artifactId>nvdb-api-client</artifactId>
    <version>1.1.0</version>
</dependency>

Getting started

Using the client is very simple. All it takes is a couple of lines of code.

Authentication

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.

Example

To start using the library simply instantiate the factory. It takes three arguments:

  1. Base URL for the API
  2. Value for request header User-Agent
  3. 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();

How to build

The repo contains the Gradle wrapper. The client is built running:

// Simple compilation 
./gradlew build

// Publish to your Maven local
./gradlew publishToMavenLocal
You can’t perform that action at this time.