From 1c2a622f7fcef9ebd5cb74ade3869a3dfc3ca6af Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Tue, 30 Jan 2024 11:56:26 +0000 Subject: [PATCH] Upgrade to Commons Compress 1.25.0 Closes gh-39148 --- spring-boot-project/spring-boot-parent/build.gradle | 2 +- .../spring-boot-buildpack-platform/build.gradle | 2 +- .../buildpack/platform/build/ImageBuildpack.java | 6 +++--- .../buildpack/platform/build/TarGzipBuildpack.java | 6 +++--- .../boot/buildpack/platform/docker/DockerApi.java | 4 ++-- .../platform/build/DirectoryBuildpackTests.java | 6 +++--- .../platform/build/ImageBuildpackTests.java | 6 +++--- .../buildpack/platform/docker/DockerApiTests.java | 10 +++++----- .../platform/docker/type/ImageArchiveTests.java | 12 ++++++------ .../buildpack/platform/docker/type/LayerTests.java | 8 ++++---- .../boot/buildpack/platform/io/TarArchiveTests.java | 6 +++--- .../buildpack/platform/io/TarLayoutWriterTests.java | 6 +++--- .../platform/io/ZipFileTarArchiveTests.java | 6 +++--- .../ApplicationPluginActionIntegrationTests.java | 6 +++--- .../boot/image/assertions/ImageAssert.java | 10 +++++----- 15 files changed, 48 insertions(+), 48 deletions(-) diff --git a/spring-boot-project/spring-boot-parent/build.gradle b/spring-boot-project/spring-boot-parent/build.gradle index 48b8d88b3b6..cf30f9dd587 100644 --- a/spring-boot-project/spring-boot-parent/build.gradle +++ b/spring-boot-project/spring-boot-parent/build.gradle @@ -34,7 +34,7 @@ bom { ] } } - library("Commons Compress", "1.21") { + library("Commons Compress", "1.25.0") { group("org.apache.commons") { modules = [ "commons-compress" diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/build.gradle b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/build.gradle index d890be6a2af..d6b393c6819 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/build.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/build.gradle @@ -22,7 +22,7 @@ dependencies { api("com.fasterxml.jackson.core:jackson-databind") api("com.fasterxml.jackson.module:jackson-module-parameter-names") api("net.java.dev.jna:jna-platform") - api("org.apache.commons:commons-compress:1.19") + api("org.apache.commons:commons-compress") api("org.apache.httpcomponents.client5:httpclient5") api("org.springframework:spring-core") api("org.tomlj:tomlj:1.0.0") diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/ImageBuildpack.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/ImageBuildpack.java index 5a76b8ab0cc..827f4a8da01 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/ImageBuildpack.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/ImageBuildpack.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -131,12 +131,12 @@ final class ImageBuildpack implements Buildpack { try (TarArchiveInputStream tarIn = new TarArchiveInputStream(Files.newInputStream(path)); TarArchiveOutputStream tarOut = new TarArchiveOutputStream(out)) { tarOut.setLongFileMode(TarArchiveOutputStream.LONGFILE_POSIX); - TarArchiveEntry entry = tarIn.getNextTarEntry(); + TarArchiveEntry entry = tarIn.getNextEntry(); while (entry != null) { tarOut.putArchiveEntry(entry); StreamUtils.copy(tarIn, tarOut); tarOut.closeArchiveEntry(); - entry = tarIn.getNextTarEntry(); + entry = tarIn.getNextEntry(); } tarOut.finish(); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/TarGzipBuildpack.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/TarGzipBuildpack.java index 735c76619f6..4174166f3d2 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/TarGzipBuildpack.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/TarGzipBuildpack.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -90,13 +90,13 @@ final class TarGzipBuildpack implements Buildpack { new GzipCompressorInputStream(Files.newInputStream(this.path))); TarArchiveOutputStream output = new TarArchiveOutputStream(outputStream)) { writeBasePathEntries(output, basePath); - TarArchiveEntry entry = tar.getNextTarEntry(); + TarArchiveEntry entry = tar.getNextEntry(); while (entry != null) { entry.setName(basePath + "/" + entry.getName()); output.putArchiveEntry(entry); StreamUtils.copy(tar, output); output.closeArchiveEntry(); - entry = tar.getNextTarEntry(); + entry = tar.getNextEntry(); } output.finish(); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/DockerApi.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/DockerApi.java index d6c788259ad..8847290f6c0 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/DockerApi.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/DockerApi.java @@ -296,7 +296,7 @@ public class DockerApi { ImageArchiveManifest manifest = null; Map layerFiles = new HashMap<>(); try (TarArchiveInputStream tar = new TarArchiveInputStream(response.getContent())) { - TarArchiveEntry entry = tar.getNextTarEntry(); + TarArchiveEntry entry = tar.getNextEntry(); while (entry != null) { if (entry.getName().equals("manifest.json")) { manifest = readManifest(tar); @@ -304,7 +304,7 @@ public class DockerApi { if (entry.getName().endsWith(".tar")) { layerFiles.put(entry.getName(), copyToTemp(tar)); } - entry = tar.getNextTarEntry(); + entry = tar.getNextEntry(); } } Assert.notNull(manifest, "Manifest not found in image " + reference); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/DirectoryBuildpackTests.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/DirectoryBuildpackTests.java index bb9c95b61b2..3fdbd121859 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/DirectoryBuildpackTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/DirectoryBuildpackTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -128,10 +128,10 @@ class DirectoryBuildpackTests { byte[] content = layers.get(0).toByteArray(); try (TarArchiveInputStream tar = new TarArchiveInputStream(new ByteArrayInputStream(content))) { List entries = new ArrayList<>(); - TarArchiveEntry entry = tar.getNextTarEntry(); + TarArchiveEntry entry = tar.getNextEntry(); while (entry != null) { entries.add(entry); - entry = tar.getNextTarEntry(); + entry = tar.getNextEntry(); } assertThat(entries).extracting("name", "mode") .containsExactlyInAnyOrder(tuple("/cnb/", 0755), tuple("/cnb/buildpacks/", 0755), diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/ImageBuildpackTests.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/ImageBuildpackTests.java index 2ad43f3ecc1..cebc8c0bd47 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/ImageBuildpackTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/ImageBuildpackTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -213,10 +213,10 @@ class ImageBuildpackTests extends AbstractJsonTests { byte[] content = layers.get(0).toByteArray(); List entries = new ArrayList<>(); try (TarArchiveInputStream tar = new TarArchiveInputStream(new ByteArrayInputStream(content))) { - TarArchiveEntry entry = tar.getNextTarEntry(); + TarArchiveEntry entry = tar.getNextEntry(); while (entry != null) { entries.add(entry); - entry = tar.getNextTarEntry(); + entry = tar.getNextEntry(); } } assertThat(entries).extracting("name", "mode") diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/DockerApiTests.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/DockerApiTests.java index 2bb460b85cd..6bb99134266 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/DockerApiTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/DockerApiTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -336,10 +336,10 @@ class DockerApiTests { archive.writeTo(out); try (TarArchiveInputStream in = new TarArchiveInputStream( new ByteArrayInputStream(out.toByteArray()))) { - TarArchiveEntry entry = in.getNextTarEntry(); + TarArchiveEntry entry = in.getNextEntry(); while (entry != null) { contents.add(name, entry.getName()); - entry = in.getNextTarEntry(); + entry = in.getNextEntry(); } } }); @@ -364,10 +364,10 @@ class DockerApiTests { archive.writeTo(out); try (TarArchiveInputStream in = new TarArchiveInputStream( new ByteArrayInputStream(out.toByteArray()))) { - TarArchiveEntry entry = in.getNextTarEntry(); + TarArchiveEntry entry = in.getNextEntry(); while (entry != null) { contents.add(name, entry.getName()); - entry = in.getNextTarEntry(); + entry = in.getNextEntry(); } } }); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/ImageArchiveTests.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/ImageArchiveTests.java index 318bf7985c5..123f49bbcdd 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/ImageArchiveTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/ImageArchiveTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2022 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -54,14 +54,14 @@ class ImageArchiveTests extends AbstractJsonTests { try (TarArchiveInputStream tar = new TarArchiveInputStream( new ByteArrayInputStream(outputStream.toByteArray()))) { for (int i = 0; i < EXISTING_IMAGE_LAYER_COUNT; i++) { - TarArchiveEntry blankEntry = tar.getNextTarEntry(); + TarArchiveEntry blankEntry = tar.getNextEntry(); assertThat(blankEntry.getName()).isEqualTo("blank_" + i); } - TarArchiveEntry layerEntry = tar.getNextTarEntry(); + TarArchiveEntry layerEntry = tar.getNextEntry(); byte[] layerContent = read(tar, layerEntry.getSize()); - TarArchiveEntry configEntry = tar.getNextTarEntry(); + TarArchiveEntry configEntry = tar.getNextEntry(); byte[] configContent = read(tar, configEntry.getSize()); - TarArchiveEntry manifestEntry = tar.getNextTarEntry(); + TarArchiveEntry manifestEntry = tar.getNextEntry(); byte[] manifestContent = read(tar, manifestEntry.getSize()); assertExpectedLayer(layerEntry, layerContent); assertExpectedConfig(configEntry, configContent); @@ -72,7 +72,7 @@ class ImageArchiveTests extends AbstractJsonTests { private void assertExpectedLayer(TarArchiveEntry entry, byte[] content) throws Exception { assertThat(entry.getName()).isEqualTo("bb09e17fd1bd2ee47155f1349645fcd9fff31e1247c7ed99cad469f1c16a4216.tar"); try (TarArchiveInputStream tar = new TarArchiveInputStream(new ByteArrayInputStream(content))) { - TarArchiveEntry contentEntry = tar.getNextTarEntry(); + TarArchiveEntry contentEntry = tar.getNextEntry(); assertThat(contentEntry.getName()).isEqualTo("/spring/"); } } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/LayerTests.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/LayerTests.java index db72d542c7c..bad2124fb8d 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/LayerTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/LayerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -61,9 +61,9 @@ class LayerTests { layer.writeTo(outputStream); try (TarArchiveInputStream tarStream = new TarArchiveInputStream( new ByteArrayInputStream(outputStream.toByteArray()))) { - assertThat(tarStream.getNextTarEntry().getName()).isEqualTo("/directory/"); - assertThat(tarStream.getNextTarEntry().getName()).isEqualTo("/directory/file"); - assertThat(tarStream.getNextTarEntry()).isNull(); + assertThat(tarStream.getNextEntry().getName()).isEqualTo("/directory/"); + assertThat(tarStream.getNextEntry().getName()).isEqualTo("/directory/file"); + assertThat(tarStream.getNextEntry()).isNull(); } } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/io/TarArchiveTests.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/io/TarArchiveTests.java index 0f5be72a0f7..1a587eb5be6 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/io/TarArchiveTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/io/TarArchiveTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -58,10 +58,10 @@ class TarArchiveTests { try (TarArchiveInputStream tarStream = new TarArchiveInputStream( new ByteArrayInputStream(outputStream.toByteArray()))) { List entries = new ArrayList<>(); - TarArchiveEntry entry = tarStream.getNextTarEntry(); + TarArchiveEntry entry = tarStream.getNextEntry(); while (entry != null) { entries.add(entry); - entry = tarStream.getNextTarEntry(); + entry = tarStream.getNextEntry(); } assertThat(entries).hasSize(6); assertThat(entries.get(0).getName()).isEqualTo("/workspace/"); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/io/TarLayoutWriterTests.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/io/TarLayoutWriterTests.java index 847abc77fa8..f212ad69fe5 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/io/TarLayoutWriterTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/io/TarLayoutWriterTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -44,8 +44,8 @@ class TarLayoutWriterTests { } try (TarArchiveInputStream tarInputStream = new TarArchiveInputStream( new ByteArrayInputStream(outputStream.toByteArray()))) { - TarArchiveEntry directoryEntry = tarInputStream.getNextTarEntry(); - TarArchiveEntry fileEntry = tarInputStream.getNextTarEntry(); + TarArchiveEntry directoryEntry = tarInputStream.getNextEntry(); + TarArchiveEntry fileEntry = tarInputStream.getNextEntry(); byte[] fileContent = new byte[(int) fileEntry.getSize()]; tarInputStream.read(fileContent); assertThat(tarInputStream.getNextEntry()).isNull(); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/io/ZipFileTarArchiveTests.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/io/ZipFileTarArchiveTests.java index cd11ef39298..48c2f6f70e1 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/io/ZipFileTarArchiveTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/io/ZipFileTarArchiveTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -67,11 +67,11 @@ class ZipFileTarArchiveTests { tarArchive.writeTo(outputStream); try (TarArchiveInputStream tarStream = new TarArchiveInputStream( new ByteArrayInputStream(outputStream.toByteArray()))) { - TarArchiveEntry dirEntry = tarStream.getNextTarEntry(); + TarArchiveEntry dirEntry = tarStream.getNextEntry(); assertThat(dirEntry.getName()).isEqualTo("spring/"); assertThat(dirEntry.getLongUserId()).isEqualTo(123); assertThat(dirEntry.getLongGroupId()).isEqualTo(456); - TarArchiveEntry fileEntry = tarStream.getNextTarEntry(); + TarArchiveEntry fileEntry = tarStream.getNextEntry(); assertThat(fileEntry.getName()).isEqualTo("spring/boot"); assertThat(fileEntry.getLongUserId()).isEqualTo(123); assertThat(fileEntry.getLongGroupId()).isEqualTo(456); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/plugin/ApplicationPluginActionIntegrationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/plugin/ApplicationPluginActionIntegrationTests.java index d30629bb32d..292dd2bbd52 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/plugin/ApplicationPluginActionIntegrationTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/plugin/ApplicationPluginActionIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -195,7 +195,7 @@ class ApplicationPluginActionIntegrationTests { List entryNames = new ArrayList<>(); try (TarArchiveInputStream input = new TarArchiveInputStream(new FileInputStream(distribution))) { TarArchiveEntry entry; - while ((entry = input.getNextTarEntry()) != null) { + while ((entry = input.getNextEntry()) != null) { entryNames.add(entry.getName()); } } @@ -205,7 +205,7 @@ class ApplicationPluginActionIntegrationTests { private void tarEntries(File distribution, Consumer consumer) throws IOException { try (TarArchiveInputStream input = new TarArchiveInputStream(new FileInputStream(distribution))) { TarArchiveEntry entry; - while ((entry = input.getNextTarEntry()) != null) { + while ((entry = input.getNextEntry()) != null) { consumer.accept(entry); } } diff --git a/spring-boot-system-tests/spring-boot-image-tests/src/systemTest/java/org/springframework/boot/image/assertions/ImageAssert.java b/spring-boot-system-tests/spring-boot-image-tests/src/systemTest/java/org/springframework/boot/image/assertions/ImageAssert.java index 39b879011cb..fc5f9509412 100644 --- a/spring-boot-system-tests/spring-boot-image-tests/src/systemTest/java/org/springframework/boot/image/assertions/ImageAssert.java +++ b/spring-boot-system-tests/spring-boot-image-tests/src/systemTest/java/org/springframework/boot/image/assertions/ImageAssert.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -80,12 +80,12 @@ public class ImageAssert extends AbstractAssert { this.actual.writeTo(out); try (TarArchiveInputStream in = new TarArchiveInputStream( new ByteArrayInputStream(out.toByteArray()))) { - TarArchiveEntry entry = in.getNextTarEntry(); + TarArchiveEntry entry = in.getNextEntry(); while (entry != null) { if (!entry.isDirectory()) { entryNames.add(entry.getName().replaceFirst("^/workspace/", "")); } - entry = in.getNextTarEntry(); + entry = in.getNextEntry(); } } } @@ -101,7 +101,7 @@ public class ImageAssert extends AbstractAssert { this.actual.writeTo(out); try (TarArchiveInputStream in = new TarArchiveInputStream( new ByteArrayInputStream(out.toByteArray()))) { - TarArchiveEntry entry = in.getNextTarEntry(); + TarArchiveEntry entry = in.getNextEntry(); while (entry != null) { if (entry.getName().equals(name)) { ByteArrayOutputStream entryOut = new ByteArrayOutputStream(); @@ -109,7 +109,7 @@ public class ImageAssert extends AbstractAssert { assertConsumer.accept(new JsonContentAssert(LayerContentAssert.class, entryOut.toString())); return; } - entry = in.getNextTarEntry(); + entry = in.getNextEntry(); } } failWithMessage("Expected JSON entry '%s' in layer with digest '%s'", name, this.actual.getId());