Skip to content

Commit

Permalink
Merge branch '2.4.x'
Browse files Browse the repository at this point in the history
Closes gh-25938
  • Loading branch information
scottfrederick committed Apr 8, 2021
2 parents 5ca4cc9 + 9108b81 commit 86303c0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* 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");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -80,7 +80,7 @@ private void assertArchiveHasEntries(File jarFile) {
+ "' is not compatible with buildpacks; ensure jar file is valid and launch script is not enabled");
}
catch (IOException ex) {
throw new IllegalStateException("File is not readable", ex);
throw new IllegalStateException("File '" + jarFile + "' is not readable", ex);
}
}

Expand All @@ -99,6 +99,7 @@ private TarArchiveEntry convert(ZipArchiveEntry zipEntry) {
tarEntry.setUserId(this.owner.getUid());
tarEntry.setGroupId(this.owner.getGid());
tarEntry.setModTime(NORMALIZED_MOD_TIME);
tarEntry.setMode(zipEntry.getUnixMode());
if (!zipEntry.isDirectory()) {
tarEntry.setSize(zipEntry.getSize());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* 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");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -36,6 +36,7 @@
* Tests for {@link ZipFileTarArchive}.
*
* @author Phillip Webb
* @author Scott Frederick
*/
class ZipFileTarArchiveTests {

Expand Down Expand Up @@ -75,6 +76,7 @@ void writeToAdaptsContent() throws Exception {
assertThat(fileEntry.getLongUserId()).isEqualTo(123);
assertThat(fileEntry.getLongGroupId()).isEqualTo(456);
assertThat(fileEntry.getSize()).isEqualTo(4);
assertThat(fileEntry.getMode()).isEqualTo(0755);
assertThat(tarStream).hasContent("test");
}
}
Expand All @@ -85,6 +87,7 @@ private void writeTestZip(File file) throws IOException {
zip.putArchiveEntry(dirEntry);
zip.closeArchiveEntry();
ZipArchiveEntry fileEntry = new ZipArchiveEntry("spring/boot");
fileEntry.setUnixMode(0755);
zip.putArchiveEntry(fileEntry);
zip.write("test".getBytes(StandardCharsets.UTF_8));
zip.closeArchiveEntry();
Expand Down

0 comments on commit 86303c0

Please sign in to comment.