Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
version: [11, 17, 21]
version: [17, 21, 25]
steps:
- name: Checkout
uses: actions/checkout@v6
Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ plugins {
id 'eclipse'
id 'pmd'

id 'com.diffplug.spotless' version '6.21.0'
id 'com.diffplug.spotless' version '8.1.0'

/* We have to use this 3rd party plugin for publishing to MavenCentral because as of AUG-2025 there is no official
* plugin which supports publishing to MavenCentral Portal. */
id "com.vanniktech.maven.publish.base" version "0.34.0"
id "com.vanniktech.maven.publish.base" version "0.36.0"
}

allprojects {
Expand Down Expand Up @@ -69,7 +69,7 @@ allprojects {

pmd {
consoleOutput = true
toolVersion = "7.12.0"
toolVersion = "7.20.0"

// This tells PMD to use your custom ruleset file.
ruleSetFiles = rootProject.files("config/pmd/pmd-ruleset.xml")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import java.security.NoSuchAlgorithmException;
import java.security.interfaces.RSAPrivateKey;
import java.security.spec.InvalidKeySpecException;
import java.util.Date;
import java.time.Instant;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
Expand Down Expand Up @@ -200,7 +200,7 @@ public KeyFlowTokenResponse(
}

protected boolean isExpired() {
return expiresIn < new Date().toInstant().getEpochSecond();
return expiresIn < Instant.now().getEpochSecond();
}

protected String getAccessToken() {
Expand Down Expand Up @@ -342,8 +342,8 @@ private String generateSelfSignedJWT()
.withSubject(saKey.getCredentials().getSub())
.withJWTId(UUID.randomUUID().toString())
.withAudience(saKey.getCredentials().getAud())
.withIssuedAt(new Date())
.withExpiresAt(new Date().toInstant().plusSeconds(10 * 60))
.withIssuedAt(Instant.now())
.withExpiresAt(Instant.now().plusSeconds(10 * 60))
.withHeader(jwtHeader)
.sign(algorithm);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ protected static String readValueFromCredentialsFile(
} catch (ClassCastException ignored) {
}
if (Utils.isStringSet(keyPath)) {
return new String(Files.readAllBytes(Paths.get(keyPath)));
return new String(Files.readAllBytes(Paths.get(keyPath)), StandardCharsets.UTF_8);
}
throw new CredentialsInFileNotFoundException(
"could not find " + valueKey + " or " + pathKey + " in " + path);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ private AlbExample() {}
"PMD.CognitiveComplexity",
"PMD.CommentSize",
"PMD.CyclomaticComplexity",
"PMD.NPathComplexity",
"PMD.NcssCount",
"PMD.SystemPrintln",
"PMD.AvoidThrowingRawExceptionTypes"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

final class AuthenticationExample {
Expand Down Expand Up @@ -53,7 +54,7 @@ public static void main(String[] args) throws IOException {
"examples/authentication/src/main/java/cloud/stackit/sdk/authentication/examples/dummy_credentials/dummy-service-account-key.json";
File serviceAccountKeyFile = new File(serviceAccountKeyPath);
StringBuilder serviceAccountKeyContent = new StringBuilder();
try (Scanner myReader = new Scanner(serviceAccountKeyFile)) {
try (Scanner myReader = new Scanner(serviceAccountKeyFile, StandardCharsets.UTF_8.name())) {
while (myReader.hasNextLine()) {
serviceAccountKeyContent.append(myReader.nextLine());
}
Expand All @@ -66,7 +67,7 @@ public static void main(String[] args) throws IOException {
"examples/authentication/src/main/java/cloud/stackit/sdk/authentication/examples/dummy_credentials/dummy-private-key.pem";
File privateKeyFile = new File(privateKeyPath);
StringBuilder privateKeyContent = new StringBuilder();
try (Scanner myReader = new Scanner(privateKeyFile)) {
try (Scanner myReader = new Scanner(privateKeyFile, StandardCharsets.UTF_8.name())) {
while (myReader.hasNextLine()) {
privateKeyContent.append(myReader.nextLine());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ private LoadBalancerExample() {}
"PMD.CognitiveComplexity",
"PMD.CommentSize",
"PMD.CyclomaticComplexity",
"PMD.NPathComplexity",
"PMD.NcssCount",
"PMD.SystemPrintln",
"PMD.AvoidThrowingRawExceptionTypes"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ private ObjectStorageExample() {}

@SuppressWarnings({
"PMD.CyclomaticComplexity",
"PMD.CognitiveComplexity",
"PMD.NPathComplexity",
"PMD.NcssCount",
"PMD.SystemPrintln",
"PMD.AvoidThrowingRawExceptionTypes"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ final class ResourcemanagerExample {
/** Prevent instantiation */
private ResourcemanagerExample() {}

@SuppressWarnings({"PMD.SystemPrintln", "PMD.AvoidThrowingRawExceptionTypes"})
@SuppressWarnings({"PMD.SystemPrintln"})
public static void main(String[] args)
throws IOException, ApiException, InterruptedException, ExecutionException {
// Credentials are read from the credentialsFile in `~/.stackit/credentials.json` or the env
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ private ServerUpdateExample() {}
@SuppressWarnings({
"PMD.CyclomaticComplexity",
"PMD.CognitiveComplexity",
"PMD.NPathComplexity",
"PMD.NcssCount",
"PMD.SystemPrintln",
"PMD.AvoidThrowingRawExceptionTypes",
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Loading