Skip to content

Commit

Permalink
[base64] Use java natively (#1130)
Browse files Browse the repository at this point in the history
especially not use plexus utils as that is for maven only.
  • Loading branch information
hazendaz authored Dec 26, 2023
1 parent 83d7aed commit 3fd187c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
5 changes: 0 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,6 @@
<artifactId>commons-io</artifactId>
<version>2.7</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>3.5.1</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/masterthought/cucumber/json/Embedding.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import java.util.Locale;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import org.codehaus.plexus.util.Base64;
import java.util.Base64;

import net.masterthought.cucumber.json.deserializers.EmbeddingDeserializer;

Expand Down Expand Up @@ -51,7 +51,7 @@ public String getName() {
}

public String getDecodedData() {
return new String(Base64.decodeBase64(data.getBytes(StandardCharsets.UTF_8)), StandardCharsets.UTF_8);
return new String(Base64.getDecoder().decode(data.getBytes(StandardCharsets.UTF_8)), StandardCharsets.UTF_8);
}

public String getFileName() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import java.nio.charset.StandardCharsets;

import org.codehaus.plexus.util.Base64;
import java.util.Base64;

import net.masterthought.cucumber.json.Embedding;

Expand Down Expand Up @@ -33,6 +33,6 @@ private WebAssertion getBox() {
}

private String getDecodedData(String data) {
return new String(Base64.decodeBase64(data.getBytes(StandardCharsets.UTF_8)), StandardCharsets.UTF_8);
return new String(Base64.getDecoder().decode(data.getBytes(StandardCharsets.UTF_8)), StandardCharsets.UTF_8);
}
}

0 comments on commit 3fd187c

Please sign in to comment.