Merge branch 'main' into 4.0.x

This commit is contained in:
Andy Wilkinson
2025-06-12 10:07:52 +01:00
5 changed files with 12 additions and 11 deletions

View File

@@ -35,7 +35,6 @@ import java.util.Map;
import org.apache.commons.compress.archivers.ArchiveEntry;
import org.apache.commons.compress.archivers.tar.TarArchiveInputStream;
import org.apache.commons.compress.utils.IOUtils;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
@@ -46,6 +45,7 @@ import org.springframework.boot.buildpack.platform.docker.type.ImageConfig;
import org.springframework.boot.buildpack.platform.docker.type.ImageReference;
import org.springframework.boot.buildpack.platform.json.AbstractJsonTests;
import org.springframework.util.FileCopyUtils;
import org.springframework.util.StreamUtils;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.entry;
@@ -202,7 +202,7 @@ class EphemeralBuilderTests extends AbstractJsonTests {
else {
file.getParentFile().mkdirs();
try (OutputStream out = new FileOutputStream(file)) {
IOUtils.copy(archive, out);
StreamUtils.copy(archive, out);
}
}
entry = archive.getNextEntry();

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2025 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.
@@ -31,9 +31,9 @@ import org.apache.commons.compress.archivers.tar.TarArchiveEntry;
import org.apache.commons.compress.archivers.tar.TarArchiveInputStream;
import org.apache.commons.compress.archivers.tar.TarArchiveOutputStream;
import org.apache.commons.compress.compressors.gzip.GzipCompressorOutputStream;
import org.apache.commons.compress.utils.IOUtils;
import org.springframework.util.FileCopyUtils;
import org.springframework.util.StreamUtils;
import static org.assertj.core.api.Assertions.assertThat;
@@ -110,7 +110,7 @@ class TestTarGzip {
TarArchiveEntry entry = new TarArchiveEntry(entryName);
entry.setSize(content.length());
tar.putArchiveEntry(entry);
IOUtils.copy(new ByteArrayInputStream(content.getBytes(StandardCharsets.UTF_8)), tar);
StreamUtils.copy(new ByteArrayInputStream(content.getBytes(StandardCharsets.UTF_8)), tar);
tar.closeArchiveEntry();
}

View File

@@ -33,7 +33,6 @@ import java.util.Set;
import org.apache.commons.compress.archivers.tar.TarArchiveEntry;
import org.apache.commons.compress.archivers.tar.TarArchiveOutputStream;
import org.apache.commons.compress.compressors.gzip.GzipCompressorOutputStream;
import org.apache.commons.compress.utils.IOUtils;
import org.gradle.testkit.runner.BuildResult;
import org.gradle.testkit.runner.TaskOutcome;
import org.junit.jupiter.api.TestTemplate;
@@ -53,6 +52,7 @@ import org.springframework.boot.testsupport.container.DisabledIfDockerUnavailabl
import org.springframework.boot.testsupport.gradle.testkit.GradleBuild;
import org.springframework.boot.testsupport.junit.DisabledOnOs;
import org.springframework.util.FileSystemUtils;
import org.springframework.util.StreamUtils;
import static org.assertj.core.api.Assertions.assertThat;
@@ -623,7 +623,7 @@ class BootBuildImageIntegrationTests {
TarArchiveEntry entry = new TarArchiveEntry(file, name);
entry.setMode(mode);
tar.putArchiveEntry(entry);
IOUtils.copy(Files.newInputStream(file.toPath()), tar);
StreamUtils.copy(Files.newInputStream(file.toPath()), tar);
tar.closeArchiveEntry();
}