Skip to content

Commit 2f2f28a

Browse files
authored
BI-561 - NoSuchMethodError thrown using IOUtils.toString(String, StandardCharsets) (#450)
1 parent 5cd06ac commit 2f2f28a

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

build-info-client/src/main/java/org/jfrog/build/client/ArtifactoryHttpClient.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ public ArtifactoryUploadResponse execute(HttpPut httpPut) throws IOException {
251251
return artifactoryResponse;
252252
}
253253
try (InputStream in = response.getEntity().getContent()) {
254-
String content = IOUtils.toString(in, StandardCharsets.UTF_8);
254+
String content = IOUtils.toString(in, StandardCharsets.UTF_8.name());
255255
if (StringUtils.isEmpty(content)) {
256256
return artifactoryResponse;
257257
}
@@ -296,7 +296,7 @@ public String getMessageFromEntity(HttpEntity entity) throws IOException {
296296
private String getResponseEntityContent(HttpEntity responseEntity) throws IOException {
297297
InputStream in = responseEntity.getContent();
298298
if (in != null) {
299-
return IOUtils.toString(in, StandardCharsets.UTF_8);
299+
return IOUtils.toString(in, StandardCharsets.UTF_8.name());
300300
}
301301
return "";
302302
}

build-info-extractor-docker/src/main/java/org/jfrog/build/extractor/docker/DockerUtils.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ public static int getNumberOfDependentLayers(String imageContent) throws IOExcep
229229
public static String entityToString(HttpEntity entity) throws IOException {
230230
if (entity != null) {
231231
InputStream is = entity.getContent();
232-
return IOUtils.toString(is, StandardCharsets.UTF_8);
232+
return IOUtils.toString(is, StandardCharsets.UTF_8.name());
233233
}
234234
return "";
235235
}

build-info-extractor-docker/src/main/java/org/jfrog/build/extractor/docker/types/DockerImage.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ private Pair<String, String> getManifestFromArtifactory(ArtifactoryDependenciesC
9595
logger.info("Trying to download manifest from " + downloadUrl);
9696
try (CloseableHttpResponse response = dependenciesClient.downloadArtifact(downloadUrl)) {
9797
entity = response.getEntity();
98-
return Pair.of(IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8), pathWithoutRepo);
98+
return Pair.of(IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8.name()), pathWithoutRepo);
9999
} catch (Exception e) {
100100
if (dependenciesClient.isLocalRepo(targetRepo)) {
101101
throw e;
@@ -121,7 +121,7 @@ private Pair<String, String> getManifestFromArtifactory(ArtifactoryDependenciesC
121121
try (CloseableHttpResponse response = dependenciesClient.downloadArtifact(downloadUrl)) {
122122
entity = response.getEntity();
123123
pathWithoutRepo = StringUtils.substringAfter(manifestPath, "/");
124-
return Pair.of(IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8), pathWithoutRepo);
124+
return Pair.of(IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8.name()), pathWithoutRepo);
125125
}
126126
} finally {
127127
EntityUtils.consumeQuietly(entity);

0 commit comments

Comments
 (0)