Skip to content

Latest commit

 

History

History
66 lines (48 loc) · 1.64 KB

README.md

File metadata and controls

66 lines (48 loc) · 1.64 KB

ntk-client-java

Maven Central

Official Java client for the NetToolKit web API.

Installation

Requirements

Java 11 or later. If you'd like to use the client with an earlier Java version, please let us know.

Maven

<dependency>
  <groupId>com.nettoolkit</groupId>
  <artifactId>ntk-client-java</artifactId>
  <version>1.1.0-beta</version>
</dependency>

Documentation

See the web API docs for a general explanation.

Usage

Example.java

import com.nettoolkit.gatekeeper.GatekeeperClient;
import com.nettoolkit.gatekeeper.Visit;
import com.nettoolkit.exception.NetToolKitException;

public class Example {
    public static void main() throws Exception {
        String apiKey = "NTK_API_KEY";
        try {
            GatekeeperClient gatekeeperClient = new GatekeeperClient(apiKey);
            Visit visit = gatekeeperClient.newAuthorizeVisitRequest()
                .ip("1.2.3.4")
                .url("https://example.com/hello")
                .send();
            System.out.println(visit);
        } catch (NetToolKitException ntke) {
            ntke.printStackTrace();
        }
    }
}

Developers

Build jar file and javadoc

mvn clean package

Deploy to Maven Central

Edit pom.xml and increment the version number. The client uses semantic versioning.

mvn clean deploy