Official Java client for the NetToolKit web API.
Java 11 or later. If you'd like to use the client with an earlier Java version, please let us know.
<dependency>
<groupId>com.nettoolkit</groupId>
<artifactId>ntk-client-java</artifactId>
<version>1.1.0-beta</version>
</dependency>
See the web API docs for a general explanation.
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();
}
}
}
mvn clean package
Edit pom.xml
and increment the version number. The client uses semantic versioning.
mvn clean deploy