Skip to content

Commit 1c2a622

Browse files
committed
Upgrade to Commons Compress 1.25.0
Closes gh-39148
1 parent 9f1dda2 commit 1c2a622

File tree

15 files changed

+48
-48
lines changed

15 files changed

+48
-48
lines changed

spring-boot-project/spring-boot-parent/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ bom {
3434
]
3535
}
3636
}
37-
library("Commons Compress", "1.21") {
37+
library("Commons Compress", "1.25.0") {
3838
group("org.apache.commons") {
3939
modules = [
4040
"commons-compress"

spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ dependencies {
2222
api("com.fasterxml.jackson.core:jackson-databind")
2323
api("com.fasterxml.jackson.module:jackson-module-parameter-names")
2424
api("net.java.dev.jna:jna-platform")
25-
api("org.apache.commons:commons-compress:1.19")
25+
api("org.apache.commons:commons-compress")
2626
api("org.apache.httpcomponents.client5:httpclient5")
2727
api("org.springframework:spring-core")
2828
api("org.tomlj:tomlj:1.0.0")

spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/ImageBuildpack.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -131,12 +131,12 @@ private void copyLayerTar(Path path, OutputStream out) throws IOException {
131131
try (TarArchiveInputStream tarIn = new TarArchiveInputStream(Files.newInputStream(path));
132132
TarArchiveOutputStream tarOut = new TarArchiveOutputStream(out)) {
133133
tarOut.setLongFileMode(TarArchiveOutputStream.LONGFILE_POSIX);
134-
TarArchiveEntry entry = tarIn.getNextTarEntry();
134+
TarArchiveEntry entry = tarIn.getNextEntry();
135135
while (entry != null) {
136136
tarOut.putArchiveEntry(entry);
137137
StreamUtils.copy(tarIn, tarOut);
138138
tarOut.closeArchiveEntry();
139-
entry = tarIn.getNextTarEntry();
139+
entry = tarIn.getNextEntry();
140140
}
141141
tarOut.finish();
142142
}

spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/TarGzipBuildpack.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2021 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -90,13 +90,13 @@ private void copyAndRebaseEntries(OutputStream outputStream) throws IOException
9090
new GzipCompressorInputStream(Files.newInputStream(this.path)));
9191
TarArchiveOutputStream output = new TarArchiveOutputStream(outputStream)) {
9292
writeBasePathEntries(output, basePath);
93-
TarArchiveEntry entry = tar.getNextTarEntry();
93+
TarArchiveEntry entry = tar.getNextEntry();
9494
while (entry != null) {
9595
entry.setName(basePath + "/" + entry.getName());
9696
output.putArchiveEntry(entry);
9797
StreamUtils.copy(tar, output);
9898
output.closeArchiveEntry();
99-
entry = tar.getNextTarEntry();
99+
entry = tar.getNextEntry();
100100
}
101101
output.finish();
102102
}

spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/DockerApi.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -296,15 +296,15 @@ public void exportLayerFiles(ImageReference reference, IOBiConsumer<String, Path
296296
ImageArchiveManifest manifest = null;
297297
Map<String, Path> layerFiles = new HashMap<>();
298298
try (TarArchiveInputStream tar = new TarArchiveInputStream(response.getContent())) {
299-
TarArchiveEntry entry = tar.getNextTarEntry();
299+
TarArchiveEntry entry = tar.getNextEntry();
300300
while (entry != null) {
301301
if (entry.getName().equals("manifest.json")) {
302302
manifest = readManifest(tar);
303303
}
304304
if (entry.getName().endsWith(".tar")) {
305305
layerFiles.put(entry.getName(), copyToTemp(tar));
306306
}
307-
entry = tar.getNextTarEntry();
307+
entry = tar.getNextEntry();
308308
}
309309
}
310310
Assert.notNull(manifest, "Manifest not found in image " + reference);

spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/DirectoryBuildpackTests.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -128,10 +128,10 @@ private void assertHasExpectedLayers(Buildpack buildpack) throws IOException {
128128
byte[] content = layers.get(0).toByteArray();
129129
try (TarArchiveInputStream tar = new TarArchiveInputStream(new ByteArrayInputStream(content))) {
130130
List<TarArchiveEntry> entries = new ArrayList<>();
131-
TarArchiveEntry entry = tar.getNextTarEntry();
131+
TarArchiveEntry entry = tar.getNextEntry();
132132
while (entry != null) {
133133
entries.add(entry);
134-
entry = tar.getNextTarEntry();
134+
entry = tar.getNextEntry();
135135
}
136136
assertThat(entries).extracting("name", "mode")
137137
.containsExactlyInAnyOrder(tuple("/cnb/", 0755), tuple("/cnb/buildpacks/", 0755),

spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/ImageBuildpackTests.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -213,10 +213,10 @@ private void assertAppliesExpectedLayers(Buildpack buildpack) throws IOException
213213
byte[] content = layers.get(0).toByteArray();
214214
List<TarArchiveEntry> entries = new ArrayList<>();
215215
try (TarArchiveInputStream tar = new TarArchiveInputStream(new ByteArrayInputStream(content))) {
216-
TarArchiveEntry entry = tar.getNextTarEntry();
216+
TarArchiveEntry entry = tar.getNextEntry();
217217
while (entry != null) {
218218
entries.add(entry);
219-
entry = tar.getNextTarEntry();
219+
entry = tar.getNextEntry();
220220
}
221221
}
222222
assertThat(entries).extracting("name", "mode")

spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/DockerApiTests.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -336,10 +336,10 @@ void exportLayersExportsLayerTars() throws Exception {
336336
archive.writeTo(out);
337337
try (TarArchiveInputStream in = new TarArchiveInputStream(
338338
new ByteArrayInputStream(out.toByteArray()))) {
339-
TarArchiveEntry entry = in.getNextTarEntry();
339+
TarArchiveEntry entry = in.getNextEntry();
340340
while (entry != null) {
341341
contents.add(name, entry.getName());
342-
entry = in.getNextTarEntry();
342+
entry = in.getNextEntry();
343343
}
344344
}
345345
});
@@ -364,10 +364,10 @@ void exportLayersWithSymlinksExportsLayerTars() throws Exception {
364364
archive.writeTo(out);
365365
try (TarArchiveInputStream in = new TarArchiveInputStream(
366366
new ByteArrayInputStream(out.toByteArray()))) {
367-
TarArchiveEntry entry = in.getNextTarEntry();
367+
TarArchiveEntry entry = in.getNextEntry();
368368
while (entry != null) {
369369
contents.add(name, entry.getName());
370-
entry = in.getNextTarEntry();
370+
entry = in.getNextEntry();
371371
}
372372
}
373373
});

spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/ImageArchiveTests.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2022 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -54,14 +54,14 @@ void fromImageWritesToValidArchiveTar() throws Exception {
5454
try (TarArchiveInputStream tar = new TarArchiveInputStream(
5555
new ByteArrayInputStream(outputStream.toByteArray()))) {
5656
for (int i = 0; i < EXISTING_IMAGE_LAYER_COUNT; i++) {
57-
TarArchiveEntry blankEntry = tar.getNextTarEntry();
57+
TarArchiveEntry blankEntry = tar.getNextEntry();
5858
assertThat(blankEntry.getName()).isEqualTo("blank_" + i);
5959
}
60-
TarArchiveEntry layerEntry = tar.getNextTarEntry();
60+
TarArchiveEntry layerEntry = tar.getNextEntry();
6161
byte[] layerContent = read(tar, layerEntry.getSize());
62-
TarArchiveEntry configEntry = tar.getNextTarEntry();
62+
TarArchiveEntry configEntry = tar.getNextEntry();
6363
byte[] configContent = read(tar, configEntry.getSize());
64-
TarArchiveEntry manifestEntry = tar.getNextTarEntry();
64+
TarArchiveEntry manifestEntry = tar.getNextEntry();
6565
byte[] manifestContent = read(tar, manifestEntry.getSize());
6666
assertExpectedLayer(layerEntry, layerContent);
6767
assertExpectedConfig(configEntry, configContent);
@@ -72,7 +72,7 @@ void fromImageWritesToValidArchiveTar() throws Exception {
7272
private void assertExpectedLayer(TarArchiveEntry entry, byte[] content) throws Exception {
7373
assertThat(entry.getName()).isEqualTo("bb09e17fd1bd2ee47155f1349645fcd9fff31e1247c7ed99cad469f1c16a4216.tar");
7474
try (TarArchiveInputStream tar = new TarArchiveInputStream(new ByteArrayInputStream(content))) {
75-
TarArchiveEntry contentEntry = tar.getNextTarEntry();
75+
TarArchiveEntry contentEntry = tar.getNextEntry();
7676
assertThat(contentEntry.getName()).isEqualTo("/spring/");
7777
}
7878
}

spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/LayerTests.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -61,9 +61,9 @@ void ofCreatesLayer() throws Exception {
6161
layer.writeTo(outputStream);
6262
try (TarArchiveInputStream tarStream = new TarArchiveInputStream(
6363
new ByteArrayInputStream(outputStream.toByteArray()))) {
64-
assertThat(tarStream.getNextTarEntry().getName()).isEqualTo("/directory/");
65-
assertThat(tarStream.getNextTarEntry().getName()).isEqualTo("/directory/file");
66-
assertThat(tarStream.getNextTarEntry()).isNull();
64+
assertThat(tarStream.getNextEntry().getName()).isEqualTo("/directory/");
65+
assertThat(tarStream.getNextEntry().getName()).isEqualTo("/directory/file");
66+
assertThat(tarStream.getNextEntry()).isNull();
6767
}
6868
}
6969

spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/io/TarArchiveTests.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -58,10 +58,10 @@ void ofWritesTarContent() throws Exception {
5858
try (TarArchiveInputStream tarStream = new TarArchiveInputStream(
5959
new ByteArrayInputStream(outputStream.toByteArray()))) {
6060
List<TarArchiveEntry> entries = new ArrayList<>();
61-
TarArchiveEntry entry = tarStream.getNextTarEntry();
61+
TarArchiveEntry entry = tarStream.getNextEntry();
6262
while (entry != null) {
6363
entries.add(entry);
64-
entry = tarStream.getNextTarEntry();
64+
entry = tarStream.getNextEntry();
6565
}
6666
assertThat(entries).hasSize(6);
6767
assertThat(entries.get(0).getName()).isEqualTo("/workspace/");

spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/io/TarLayoutWriterTests.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -44,8 +44,8 @@ void writesTarArchive() throws Exception {
4444
}
4545
try (TarArchiveInputStream tarInputStream = new TarArchiveInputStream(
4646
new ByteArrayInputStream(outputStream.toByteArray()))) {
47-
TarArchiveEntry directoryEntry = tarInputStream.getNextTarEntry();
48-
TarArchiveEntry fileEntry = tarInputStream.getNextTarEntry();
47+
TarArchiveEntry directoryEntry = tarInputStream.getNextEntry();
48+
TarArchiveEntry fileEntry = tarInputStream.getNextEntry();
4949
byte[] fileContent = new byte[(int) fileEntry.getSize()];
5050
tarInputStream.read(fileContent);
5151
assertThat(tarInputStream.getNextEntry()).isNull();

spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/io/ZipFileTarArchiveTests.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -67,11 +67,11 @@ void writeToAdaptsContent() throws Exception {
6767
tarArchive.writeTo(outputStream);
6868
try (TarArchiveInputStream tarStream = new TarArchiveInputStream(
6969
new ByteArrayInputStream(outputStream.toByteArray()))) {
70-
TarArchiveEntry dirEntry = tarStream.getNextTarEntry();
70+
TarArchiveEntry dirEntry = tarStream.getNextEntry();
7171
assertThat(dirEntry.getName()).isEqualTo("spring/");
7272
assertThat(dirEntry.getLongUserId()).isEqualTo(123);
7373
assertThat(dirEntry.getLongGroupId()).isEqualTo(456);
74-
TarArchiveEntry fileEntry = tarStream.getNextTarEntry();
74+
TarArchiveEntry fileEntry = tarStream.getNextEntry();
7575
assertThat(fileEntry.getName()).isEqualTo("spring/boot");
7676
assertThat(fileEntry.getLongUserId()).isEqualTo(123);
7777
assertThat(fileEntry.getLongGroupId()).isEqualTo(456);

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/plugin/ApplicationPluginActionIntegrationTests.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -195,7 +195,7 @@ private List<String> tarEntryNames(File distribution) throws IOException {
195195
List<String> entryNames = new ArrayList<>();
196196
try (TarArchiveInputStream input = new TarArchiveInputStream(new FileInputStream(distribution))) {
197197
TarArchiveEntry entry;
198-
while ((entry = input.getNextTarEntry()) != null) {
198+
while ((entry = input.getNextEntry()) != null) {
199199
entryNames.add(entry.getName());
200200
}
201201
}
@@ -205,7 +205,7 @@ private List<String> tarEntryNames(File distribution) throws IOException {
205205
private void tarEntries(File distribution, Consumer<TarArchiveEntry> consumer) throws IOException {
206206
try (TarArchiveInputStream input = new TarArchiveInputStream(new FileInputStream(distribution))) {
207207
TarArchiveEntry entry;
208-
while ((entry = input.getNextTarEntry()) != null) {
208+
while ((entry = input.getNextEntry()) != null) {
209209
consumer.accept(entry);
210210
}
211211
}

spring-boot-system-tests/spring-boot-image-tests/src/systemTest/java/org/springframework/boot/image/assertions/ImageAssert.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2021 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -80,12 +80,12 @@ public ListAssert<String> entries() {
8080
this.actual.writeTo(out);
8181
try (TarArchiveInputStream in = new TarArchiveInputStream(
8282
new ByteArrayInputStream(out.toByteArray()))) {
83-
TarArchiveEntry entry = in.getNextTarEntry();
83+
TarArchiveEntry entry = in.getNextEntry();
8484
while (entry != null) {
8585
if (!entry.isDirectory()) {
8686
entryNames.add(entry.getName().replaceFirst("^/workspace/", ""));
8787
}
88-
entry = in.getNextTarEntry();
88+
entry = in.getNextEntry();
8989
}
9090
}
9191
}
@@ -101,15 +101,15 @@ public void jsonEntry(String name, Consumer<JsonContentAssert> assertConsumer) {
101101
this.actual.writeTo(out);
102102
try (TarArchiveInputStream in = new TarArchiveInputStream(
103103
new ByteArrayInputStream(out.toByteArray()))) {
104-
TarArchiveEntry entry = in.getNextTarEntry();
104+
TarArchiveEntry entry = in.getNextEntry();
105105
while (entry != null) {
106106
if (entry.getName().equals(name)) {
107107
ByteArrayOutputStream entryOut = new ByteArrayOutputStream();
108108
IOUtils.copy(in, entryOut);
109109
assertConsumer.accept(new JsonContentAssert(LayerContentAssert.class, entryOut.toString()));
110110
return;
111111
}
112-
entry = in.getNextTarEntry();
112+
entry = in.getNextEntry();
113113
}
114114
}
115115
failWithMessage("Expected JSON entry '%s' in layer with digest '%s'", name, this.actual.getId());

0 commit comments

Comments
 (0)