From 02c8e423bdf098d2686d1c3636024c46b4c2053c Mon Sep 17 00:00:00 2001 From: sllynn Date: Tue, 12 Nov 2024 10:36:17 +0000 Subject: [PATCH] fixed zarr test --- .../com/databricks/labs/mosaic/utils/PathUtils.scala | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/scala/com/databricks/labs/mosaic/utils/PathUtils.scala b/src/main/scala/com/databricks/labs/mosaic/utils/PathUtils.scala index c8bca7c39..571648c33 100644 --- a/src/main/scala/com/databricks/labs/mosaic/utils/PathUtils.scala +++ b/src/main/scala/com/databricks/labs/mosaic/utils/PathUtils.scala @@ -317,9 +317,13 @@ object PathUtils { for (path <- toCopy) { val destination = Paths.get(copyToPath, path.getFileName.toString) // noinspection SimplifyBooleanMatch - if (Files.isDirectory(path)) FileUtils.copyDirectory(path.toFile, destination.toFile) - else if (path.toFile != destination.toFile) { - FileUtils.copyFile(path.toFile, destination.toFile) + if (path != destination) { + if (Files.isDirectory(path)) { + FileUtils.copyDirectory(path.toFile, destination.toFile) + } + else { + FileUtils.copyFile(path.toFile, destination.toFile) + } } } }