parent
5369e7af29
commit
7a4c437f64
|
|
@ -47,7 +47,7 @@ bom {
|
|||
]
|
||||
}
|
||||
}
|
||||
library("Commons Compress", "1.25.0") {
|
||||
library("Commons Compress", "1.27.1") {
|
||||
group("org.apache.commons") {
|
||||
modules = [
|
||||
"commons-compress"
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ public class ZipFileTarArchive implements TarArchive {
|
|||
public void writeTo(OutputStream outputStream) throws IOException {
|
||||
TarArchiveOutputStream tar = new TarArchiveOutputStream(outputStream);
|
||||
tar.setLongFileMode(TarArchiveOutputStream.LONGFILE_POSIX);
|
||||
try (ZipFile zipFile = new ZipFile(this.zip)) {
|
||||
try (ZipFile zipFile = ZipFile.builder().setFile(this.zip).get()) {
|
||||
Enumeration<ZipArchiveEntry> entries = zipFile.getEntries();
|
||||
while (entries.hasMoreElements()) {
|
||||
ZipArchiveEntry zipEntry = entries.nextElement();
|
||||
|
|
@ -75,7 +75,7 @@ public class ZipFileTarArchive implements TarArchive {
|
|||
}
|
||||
|
||||
private void assertArchiveHasEntries(File file) {
|
||||
try (ZipFile zipFile = new ZipFile(file)) {
|
||||
try (ZipFile zipFile = ZipFile.builder().setFile(file).get()) {
|
||||
Assert.state(zipFile.getEntries().hasMoreElements(), () -> "Archive file '" + file + "' is not valid");
|
||||
}
|
||||
catch (IOException ex) {
|
||||
|
|
|
|||
|
|
@ -579,7 +579,9 @@ abstract class AbstractBootArchiveIntegrationTests {
|
|||
void defaultDirAndFileModesAreUsed() throws IOException {
|
||||
BuildResult result = this.gradleBuild.build(this.taskName);
|
||||
assertThat(result.task(":" + this.taskName).getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
|
||||
try (ZipFile jarFile = new ZipFile(new File(this.gradleBuild.getProjectDir(), "build/libs").listFiles()[0])) {
|
||||
try (ZipFile jarFile = ZipFile.builder()
|
||||
.setFile(new File(this.gradleBuild.getProjectDir(), "build/libs").listFiles()[0])
|
||||
.get()) {
|
||||
Enumeration<ZipArchiveEntry> entries = jarFile.getEntries();
|
||||
while (entries.hasMoreElements()) {
|
||||
ZipArchiveEntry entry = entries.nextElement();
|
||||
|
|
@ -605,7 +607,9 @@ abstract class AbstractBootArchiveIntegrationTests {
|
|||
"upgrading_version_8.html#unix_file_permissions_deprecated")
|
||||
.build(this.taskName);
|
||||
assertThat(result.task(":" + this.taskName).getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
|
||||
try (ZipFile jarFile = new ZipFile(new File(this.gradleBuild.getProjectDir(), "build/libs").listFiles()[0])) {
|
||||
try (ZipFile jarFile = ZipFile.builder()
|
||||
.setFile(new File(this.gradleBuild.getProjectDir(), "build/libs").listFiles()[0])
|
||||
.get()) {
|
||||
Enumeration<ZipArchiveEntry> entries = jarFile.getEntries();
|
||||
while (entries.hasMoreElements()) {
|
||||
ZipArchiveEntry entry = entries.nextElement();
|
||||
|
|
|
|||
|
|
@ -330,7 +330,7 @@ abstract class AbstractBootArchiveTests<T extends Jar & BootArchive> {
|
|||
File archiveFile = this.task.getArchiveFile().get().getAsFile();
|
||||
assertThat(Files.readAllBytes(archiveFile.toPath()))
|
||||
.startsWith(new DefaultLaunchScript(null, properties).toByteArray());
|
||||
try (ZipFile zipFile = new ZipFile(archiveFile)) {
|
||||
try (ZipFile zipFile = ZipFile.builder().setFile(archiveFile).get()) {
|
||||
assertThat(zipFile.getEntries().hasMoreElements()).isTrue();
|
||||
}
|
||||
try {
|
||||
|
|
@ -460,7 +460,7 @@ abstract class AbstractBootArchiveTests<T extends Jar & BootArchive> {
|
|||
this.task.classpath(classpathDirectory);
|
||||
executeTask();
|
||||
File archivePath = this.task.getArchiveFile().get().getAsFile();
|
||||
try (ZipFile zip = new ZipFile(archivePath)) {
|
||||
try (ZipFile zip = ZipFile.builder().setFile(archivePath).get()) {
|
||||
Enumeration<ZipArchiveEntry> entries = zip.getEntries();
|
||||
while (entries.hasMoreElements()) {
|
||||
ZipArchiveEntry entry = entries.nextElement();
|
||||
|
|
|
|||
|
|
@ -95,6 +95,7 @@ public class PluginClasspathGradleBuild extends GradleBuild {
|
|||
classpath.add(new File(pathOfJarContaining(KotlinCompilerPluginSupportPlugin.class)));
|
||||
classpath.add(new File(pathOfJarContaining(LanguageSettings.class)));
|
||||
}
|
||||
classpath.add(new File(pathOfJarContaining("org.apache.commons.io.Charsets")));
|
||||
classpath.add(new File(pathOfJarContaining(ArchiveEntry.class)));
|
||||
classpath.add(new File(pathOfJarContaining(BuildRequest.class)));
|
||||
classpath.add(new File(pathOfJarContaining(HttpClientConnectionManager.class)));
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ class RepackagerTests extends AbstractPackagerTests<Repackager> {
|
|||
assertThat(new String(bytes)).startsWith("ABC");
|
||||
assertThat(hasLauncherClasses(source)).isFalse();
|
||||
assertThat(hasLauncherClasses(this.destination)).isTrue();
|
||||
try (ZipFile zipFile = new ZipFile(this.destination)) {
|
||||
try (ZipFile zipFile = ZipFile.builder().setFile(this.destination).get()) {
|
||||
assertThat(zipFile.getEntries().hasMoreElements()).isTrue();
|
||||
}
|
||||
try {
|
||||
|
|
@ -267,7 +267,7 @@ class RepackagerTests extends AbstractPackagerTests<Repackager> {
|
|||
@Override
|
||||
protected Collection<ZipArchiveEntry> getAllPackagedEntries() throws IOException {
|
||||
List<ZipArchiveEntry> result = new ArrayList<>();
|
||||
try (ZipFile zip = new ZipFile(this.destination)) {
|
||||
try (ZipFile zip = ZipFile.builder().setFile(this.destination).get()) {
|
||||
Enumeration<ZipArchiveEntry> entries = zip.getEntries();
|
||||
while (entries.hasMoreElements()) {
|
||||
result.add(entries.nextElement());
|
||||
|
|
@ -285,7 +285,7 @@ class RepackagerTests extends AbstractPackagerTests<Repackager> {
|
|||
|
||||
@Override
|
||||
protected String getPackagedEntryContent(String name) throws IOException {
|
||||
try (ZipFile zip = new ZipFile(this.destination)) {
|
||||
try (ZipFile zip = ZipFile.builder().setFile(this.destination).get()) {
|
||||
ZipArchiveEntry entry = zip.getEntry(name);
|
||||
if (entry == null) {
|
||||
return null;
|
||||
|
|
|
|||
Loading…
Reference in New Issue