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/23 13:03:33 UTC

(jackrabbit-oak) branch OAK-11428 created (now 250312bdf9)

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

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


      at 250312bdf9 OAK-11428: Remove usage of Guava Files.copy() - oak-blob-plugins

This branch includes the following new commits:

     new 250312bdf9 OAK-11428: Remove usage of Guava Files.copy() - oak-blob-plugins

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(jackrabbit-oak) 01/01: OAK-11428: Remove usage of Guava Files.copy() - oak-blob-plugins

Posted by re...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 250312bdf91dccf2b26be4b835a12c5f602cc245
Author: Julian Reschke <re...@apache.org>
AuthorDate: Thu Jan 23 14:03:11 2025 +0100

    OAK-11428: Remove usage of Guava Files.copy() - oak-blob-plugins
---
 .../jackrabbit/oak/plugins/blob/datastore/BlobIdTracker.java      | 2 +-
 .../jackrabbit/oak/plugins/blob/AbstractDataStoreCacheTest.java   | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/oak-blob-plugins/src/main/java/org/apache/jackrabbit/oak/plugins/blob/datastore/BlobIdTracker.java b/oak-blob-plugins/src/main/java/org/apache/jackrabbit/oak/plugins/blob/datastore/BlobIdTracker.java
index 67d50298ed..06df3ba1d7 100644
--- a/oak-blob-plugins/src/main/java/org/apache/jackrabbit/oak/plugins/blob/datastore/BlobIdTracker.java
+++ b/oak-blob-plugins/src/main/java/org/apache/jackrabbit/oak/plugins/blob/datastore/BlobIdTracker.java
@@ -736,7 +736,7 @@ public class BlobIdTracker implements Closeable, BlobTracker {
                     LOG.trace("Trying a copy file operation");
                     try {
                         if (renamed.createNewFile()) {
-                            org.apache.jackrabbit.guava.common.io.Files.copy(processFile, renamed);
+                            Files.copy(processFile.toPath(), renamed.toPath(), StandardCopyOption.REPLACE_EXISTING);
                             generations.add(renamed);
                             LOG.info("{} File copied to {}", processFile.getAbsolutePath(),
                                 renamed.getAbsolutePath());
diff --git a/oak-blob-plugins/src/test/java/org/apache/jackrabbit/oak/plugins/blob/AbstractDataStoreCacheTest.java b/oak-blob-plugins/src/test/java/org/apache/jackrabbit/oak/plugins/blob/AbstractDataStoreCacheTest.java
index df954e2027..1b98de223f 100644
--- a/oak-blob-plugins/src/test/java/org/apache/jackrabbit/oak/plugins/blob/AbstractDataStoreCacheTest.java
+++ b/oak-blob-plugins/src/test/java/org/apache/jackrabbit/oak/plugins/blob/AbstractDataStoreCacheTest.java
@@ -29,6 +29,8 @@ import java.io.InputStream;
 import java.io.ObjectOutput;
 import java.io.ObjectOutputStream;
 import java.io.OutputStream;
+import java.nio.file.Files;
+import java.nio.file.StandardCopyOption;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -62,8 +64,6 @@ import org.jetbrains.annotations.Nullable;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import org.apache.jackrabbit.guava.common.io.Files;
-
 /**
  * Abstract class for DataStore cache related tests.
  */
@@ -89,7 +89,7 @@ public class AbstractDataStoreCacheTest {
             try {
                 File move = getFile(id, root);
                 move.getParentFile().mkdirs();
-                Files.copy(f, move);
+                Files.copy(f.toPath(), move.toPath(), StandardCopyOption.REPLACE_EXISTING);
                 LOG.info("In TestStagingUploader after write [{}]", move);
             } catch (IOException e) {
                 throw new DataStoreException(e);
@@ -125,7 +125,7 @@ public class AbstractDataStoreCacheTest {
             try {
                 File move = getFile(id, root);
                 move.getParentFile().mkdirs();
-                Files.copy(f, move);
+                Files.copy(f.toPath(), move.toPath(), StandardCopyOption.REPLACE_EXISTING);
                 LOG.info("In TestCacheLoader after write [{}], [{}]", id, move);
             } catch (IOException e) {
                 throw new DataStoreException(e);