Commit 9108b81b authored by Scott Frederick's avatar Scott Frederick

Merge branch '2.3.x' into 2.4.x

Closes gh-25937
parents 5aa1e683 0ad7f762
/* /*
* Copyright 2012-2020 the original author or authors. * Copyright 2012-2021 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -80,7 +80,7 @@ public class ZipFileTarArchive implements TarArchive { ...@@ -80,7 +80,7 @@ public class ZipFileTarArchive implements TarArchive {
+ "' is not compatible with buildpacks; ensure jar file is valid and launch script is not enabled"); + "' is not compatible with buildpacks; ensure jar file is valid and launch script is not enabled");
} }
catch (IOException ex) { catch (IOException ex) {
throw new IllegalStateException("File is not readable", ex); throw new IllegalStateException("File '" + jarFile + "' is not readable", ex);
} }
} }
...@@ -99,6 +99,7 @@ public class ZipFileTarArchive implements TarArchive { ...@@ -99,6 +99,7 @@ public class ZipFileTarArchive implements TarArchive {
tarEntry.setUserId(this.owner.getUid()); tarEntry.setUserId(this.owner.getUid());
tarEntry.setGroupId(this.owner.getGid()); tarEntry.setGroupId(this.owner.getGid());
tarEntry.setModTime(NORMALIZED_MOD_TIME); tarEntry.setModTime(NORMALIZED_MOD_TIME);
tarEntry.setMode(zipEntry.getUnixMode());
if (!zipEntry.isDirectory()) { if (!zipEntry.isDirectory()) {
tarEntry.setSize(zipEntry.getSize()); tarEntry.setSize(zipEntry.getSize());
} }
......
/* /*
* Copyright 2012-2020 the original author or authors. * Copyright 2012-2021 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -36,6 +36,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException ...@@ -36,6 +36,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException
* Tests for {@link ZipFileTarArchive}. * Tests for {@link ZipFileTarArchive}.
* *
* @author Phillip Webb * @author Phillip Webb
* @author Scott Frederick
*/ */
class ZipFileTarArchiveTests { class ZipFileTarArchiveTests {
...@@ -75,6 +76,7 @@ class ZipFileTarArchiveTests { ...@@ -75,6 +76,7 @@ class ZipFileTarArchiveTests {
assertThat(fileEntry.getLongUserId()).isEqualTo(123); assertThat(fileEntry.getLongUserId()).isEqualTo(123);
assertThat(fileEntry.getLongGroupId()).isEqualTo(456); assertThat(fileEntry.getLongGroupId()).isEqualTo(456);
assertThat(fileEntry.getSize()).isEqualTo(4); assertThat(fileEntry.getSize()).isEqualTo(4);
assertThat(fileEntry.getMode()).isEqualTo(0755);
assertThat(tarStream).hasContent("test"); assertThat(tarStream).hasContent("test");
} }
} }
...@@ -85,6 +87,7 @@ class ZipFileTarArchiveTests { ...@@ -85,6 +87,7 @@ class ZipFileTarArchiveTests {
zip.putArchiveEntry(dirEntry); zip.putArchiveEntry(dirEntry);
zip.closeArchiveEntry(); zip.closeArchiveEntry();
ZipArchiveEntry fileEntry = new ZipArchiveEntry("spring/boot"); ZipArchiveEntry fileEntry = new ZipArchiveEntry("spring/boot");
fileEntry.setUnixMode(0755);
zip.putArchiveEntry(fileEntry); zip.putArchiveEntry(fileEntry);
zip.write("test".getBytes(StandardCharsets.UTF_8)); zip.write("test".getBytes(StandardCharsets.UTF_8));
zip.closeArchiveEntry(); zip.closeArchiveEntry();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment