From 05c38fd0ad11457cc7ee4bec98e4e6bd198451ec Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Thu, 7 Mar 2024 18:36:41 +0100 Subject: [PATCH] update commons-compress GitOrigin-RevId: 3a5aa8c7ca0b85235c980b57c356c8b20cdf07fe --- .idea/libraries/commons_codec.xml | 10 +++++----- .idea/libraries/commons_compress.xml | 18 ++++++++++++----- .idea/libraries/commons_io.xml | 10 +++++----- .idea/libraries/compile_testing.xml | 10 +++++----- platform/jps-bootstrap/pom.xml | 4 ++-- .../src/org/apache/sanselan/util/IOUtils.java | 4 ++-- .../com/intellij/util/io/Decompressor.java | 20 ++++++++++++------- 7 files changed, 45 insertions(+), 31 deletions(-) diff --git a/.idea/libraries/commons_codec.xml b/.idea/libraries/commons_codec.xml index 9740560fe000..51c3e24e4af9 100644 --- a/.idea/libraries/commons_codec.xml +++ b/.idea/libraries/commons_codec.xml @@ -1,18 +1,18 @@ - + - - 56595fb20b0b85bc91d0d503dad50bb7f1b9afc0eed5dffa6cbb25929000484d + + ec87bfb55f22cbd1b21e2190eeda28b2b312ed2a431ee49fbdcc01812d04a5e4 - + - + \ No newline at end of file diff --git a/.idea/libraries/commons_compress.xml b/.idea/libraries/commons_compress.xml index 2dd90a72e2a7..2e2445985222 100644 --- a/.idea/libraries/commons_compress.xml +++ b/.idea/libraries/commons_compress.xml @@ -1,18 +1,26 @@ - + - - d0ec8014ebbb0749f471803122b21796afddf2e98e194e4374622e5fbaf69f49 + + 051aceb8bbcc62d0f5b2b8ac72c53767f9c59bfbd050151e65bef6f51c8ed9c9 + + + a58af12ee1b68cfd2ebb0c27caef164f084381a00ec81a48cc275fd7ea54e154 + + + - + + - + + \ No newline at end of file diff --git a/.idea/libraries/commons_io.xml b/.idea/libraries/commons_io.xml index 117fc0621e86..918698cddadc 100644 --- a/.idea/libraries/commons_io.xml +++ b/.idea/libraries/commons_io.xml @@ -1,18 +1,18 @@ - + - - a328dad730921d197b6a9b195dffa00e41c974c2dac8fe37e84d31706bca7792 + + a58af12ee1b68cfd2ebb0c27caef164f084381a00ec81a48cc275fd7ea54e154 - + - + \ No newline at end of file diff --git a/.idea/libraries/compile_testing.xml b/.idea/libraries/compile_testing.xml index 48363f4e31d1..596d3e3fa312 100644 --- a/.idea/libraries/compile_testing.xml +++ b/.idea/libraries/compile_testing.xml @@ -1,18 +1,18 @@ - + - - 55746fa706fb051a53f61d205eb66ee31e33ed1936d92b323c7001df18ad3acb + + da42c0b350c0e5717df91a7e554ee5acbf07f4b87d4d2240589521070b4bce72 - + - + \ No newline at end of file diff --git a/platform/jps-bootstrap/pom.xml b/platform/jps-bootstrap/pom.xml index c80ccc259fec..9da08acc1936 100644 --- a/platform/jps-bootstrap/pom.xml +++ b/platform/jps-bootstrap/pom.xml @@ -43,7 +43,7 @@ org.apache.commons commons-compress - 1.25.0 + 1.26.0 com.google.code.gson @@ -53,7 +53,7 @@ commons-io commons-io - 2.15.0 + 2.15.1 io.ktor diff --git a/platform/platform-impl/src/org/apache/sanselan/util/IOUtils.java b/platform/platform-impl/src/org/apache/sanselan/util/IOUtils.java index 157b7d209206..30e1b66eecea 100644 --- a/platform/platform-impl/src/org/apache/sanselan/util/IOUtils.java +++ b/platform/platform-impl/src/org/apache/sanselan/util/IOUtils.java @@ -1,4 +1,4 @@ -// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package org.apache.sanselan.util; import com.intellij.openapi.util.io.FileUtil; @@ -13,7 +13,7 @@ import java.io.*; * * @deprecated For plugin compatibility only, DO NOT USE. */ -@Deprecated +@Deprecated(forRemoval = true) public final class IOUtils { public static byte[] getInputStreamBytes(InputStream is) throws IOException { diff --git a/platform/util/src/com/intellij/util/io/Decompressor.java b/platform/util/src/com/intellij/util/io/Decompressor.java index bcc408637c12..6fcfd4695311 100644 --- a/platform/util/src/com/intellij/util/io/Decompressor.java +++ b/platform/util/src/com/intellij/util/io/Decompressor.java @@ -2,7 +2,7 @@ package com.intellij.util.io; import com.intellij.openapi.diagnostic.Logger; -import com.intellij.openapi.util.SystemInfo; +import com.intellij.openapi.util.SystemInfoRt; import com.intellij.openapi.util.io.*; import com.intellij.openapi.util.text.StringUtil; import com.intellij.util.ArrayUtil; @@ -19,8 +19,14 @@ import java.io.*; import java.nio.file.*; import java.nio.file.attribute.DosFileAttributeView; import java.nio.file.attribute.PosixFileAttributeView; -import java.util.*; -import java.util.function.*; +import java.util.ArrayDeque; +import java.util.Deque; +import java.util.Enumeration; +import java.util.List; +import java.util.function.BiConsumer; +import java.util.function.BiFunction; +import java.util.function.Consumer; +import java.util.function.Predicate; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; @@ -71,7 +77,7 @@ public abstract class Decompressor { || te.isDirectory() || te.isSymbolicLink())) /* skipping unsupported */; if (te == null) return null; - if (!SystemInfo.isWindows) return new Entry(te.getName(), type(te), te.getMode(), te.getLinkName(), te.getSize()); + if (!SystemInfoRt.isWindows) return new Entry(te.getName(), type(te), te.getMode(), te.getLinkName(), te.getSize()); // UNIX permissions are ignored on Windows if (te.isSymbolicLink()) return new Entry(te.getName(), Entry.Type.SYMLINK, 0, te.getLinkName(), te.getSize()); return new Entry(te.getName(), te.isDirectory(), te.getSize()); @@ -162,7 +168,7 @@ public abstract class Decompressor { @Override protected void openStream() throws IOException { - myZip = new org.apache.commons.compress.archivers.zip.ZipFile(Files.newByteChannel(mySource)); + myZip = new org.apache.commons.compress.archivers.zip.ZipFile.Builder().setSeekableByteChannel(Files.newByteChannel(mySource)).get(); myEntries = myZip.getEntries(); } @@ -171,7 +177,7 @@ public abstract class Decompressor { myEntry = myEntries.hasMoreElements() ? myEntries.nextElement() : null; if (myEntry == null) return null; int platform = myEntry.getPlatform(); - if (SystemInfo.isWindows) { + if (SystemInfoRt.isWindows) { // UNIX permissions are ignored on Windows if (platform == ZipArchiveEntry.PLATFORM_UNIX) { return new Entry(myEntry.getName(), type(myEntry), 0, myZip.getUnixSymlink(myEntry), myEntry.getSize()); @@ -497,7 +503,7 @@ public abstract class Decompressor { } private static void setAttributes(int mode, Path outputFile) throws IOException { - if (SystemInfo.isWindows) { + if (SystemInfoRt.isWindows) { DosFileAttributeView attrs = Files.getFileAttributeView(outputFile, DosFileAttributeView.class); if (attrs != null) { if ((mode & Entry.DOS_READ_ONLY) != 0) attrs.setReadOnly(true);