diff --git a/utils/common/src/main/kotlin/ArchiveUtils.kt b/utils/common/src/main/kotlin/ArchiveUtils.kt index fdbda6b89ebb0..d0816eeca3627 100644 --- a/utils/common/src/main/kotlin/ArchiveUtils.kt +++ b/utils/common/src/main/kotlin/ArchiveUtils.kt @@ -258,7 +258,9 @@ fun InputStream.unpackZip(targetDirectory: File) = fun InputStream.unpackTar(targetDirectory: File, filter: (ArchiveEntry) -> Boolean = { true }) = TarArchiveInputStream(this).unpack( targetDirectory, - { entry -> !(entry as TarArchiveEntry).isFile || File(entry.name).isAbsolute || !filter(entry) }, + { entry -> + (entry as TarArchiveEntry).isDirectory || !entry.isFile || File(entry.name).isAbsolute || !filter(entry) + }, { entry -> (entry as TarArchiveEntry).mode } )