A Java wrapper around the AdoptOpenJDK REST API
Branch: develop
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.
net.adoptopenjdk.api
net.adoptopenjdk.checkstyle
net.adoptopenjdk.spi
net.adoptopenjdk.tests
net.adoptopenjdk.v1
src/site/resources
.gitignore
.travis.yml
README-CHANGES.xml
README-LICENSE.txt
README.md
pom.xml

README.md

openjdk-api-java-client

Build Status Maven Central Maven Central (snapshot) Codacy Badge Codecov

A Java client for the AdoptOpenJDK REST API.

adoptopenjdk

Usage

Use the following Maven dependencies:

<dependency>
  <groupId>net.adoptopenjdk</groupId>
  <artifactId>net.adoptopenjdk.api</artifactId>
  <version><!-- Insert latest version --></version>
</dependency>
<dependency>
  <groupId>net.adoptopenjdk</groupId>
  <artifactId>net.adoptopenjdk.v1</artifactId>
  <version><!-- Insert latest version --></version>
</dependency>

The first dependency specifies that you want to use the API, and the second is a basic provider for the version 1.0.0 API.

Then:

AdoptOpenJDKRequestsType requests = AdoptOpenJDK.get(1);

List<AOVariants> variants = requests.variants();
assert variants.size() > 0;

List<AORelease> releases =
  requests.releasesForVariant(variants.get(0).name());

List<AORelease> releases_8 =
  requests.releasesForVariant("openjdk8");

List<AORelease> nightlies_9 =
  requests.nightlyBuildsForVariant("openjdk9");

The API operates entirely synchronously and raises checked exceptions on failures. Do not share values of type AdoptOpenJDKRequestsType across threads.