You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by re...@apache.org on 2025/01/22 10:12:36 UTC

(jackrabbit-oak) branch OAK-11420 updated: OAK-11420: Remove usage of Guava Files copy()/move()/touch()/equals() - oak-blob-commons

This is an automated email from the ASF dual-hosted git repository.

reschke pushed a commit to branch OAK-11420
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git


The following commit(s) were added to refs/heads/OAK-11420 by this push:
     new 8a71816a86 OAK-11420: Remove usage of Guava Files copy()/move()/touch()/equals() - oak-blob-commons
8a71816a86 is described below

commit 8a71816a8614528d5d5cf82b53901b5eff83d492
Author: Julian Reschke <re...@apache.org>
AuthorDate: Wed Jan 22 11:12:24 2025 +0100

    OAK-11420: Remove usage of Guava Files copy()/move()/touch()/equals() - oak-blob-commons
---
 .../main/java/org/apache/jackrabbit/oak/commons/FileIOUtils.java   | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/oak-commons/src/main/java/org/apache/jackrabbit/oak/commons/FileIOUtils.java b/oak-commons/src/main/java/org/apache/jackrabbit/oak/commons/FileIOUtils.java
index 77eae193de..7f289768bc 100644
--- a/oak-commons/src/main/java/org/apache/jackrabbit/oak/commons/FileIOUtils.java
+++ b/oak-commons/src/main/java/org/apache/jackrabbit/oak/commons/FileIOUtils.java
@@ -21,7 +21,6 @@ import static java.nio.charset.StandardCharsets.UTF_8;
 import static org.apache.commons.io.FileUtils.forceDelete;
 import static org.apache.commons.io.IOUtils.copyLarge;
 import static org.apache.jackrabbit.guava.common.io.Closeables.close;
-import static org.apache.jackrabbit.guava.common.io.Files.move;
 import static org.apache.jackrabbit.oak.commons.sort.EscapeUtils.escapeLineBreak;
 import static org.apache.jackrabbit.oak.commons.sort.EscapeUtils.unescapeLineBreaks;
 import static org.apache.jackrabbit.oak.commons.sort.ExternalSort.mergeSortedFiles;
@@ -38,6 +37,8 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.io.OutputStream;
+import java.nio.file.Files;
+import java.nio.file.StandardCopyOption;
 import java.util.Comparator;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -73,7 +74,7 @@ public final class FileIOUtils {
     public static void sort(File file) throws IOException {
         File sorted = createTempFile("fleioutilssort", null);
         merge(sortInBatch(file, lexComparator, true), sorted);
-        move(sorted, file);
+        Files.move(sorted.toPath(), file.toPath(), StandardCopyOption.REPLACE_EXISTING);
     }
 
     /**
@@ -86,7 +87,7 @@ public final class FileIOUtils {
     public static void sort(File file, Comparator<String> comparator) throws IOException {
         File sorted = createTempFile("fleioutilssort", null);
         merge(sortInBatch(file, comparator, true), sorted, comparator);
-        move(sorted, file);
+        Files.move(sorted.toPath(), file.toPath(), StandardCopyOption.REPLACE_EXISTING);
     }
 
     /**