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 <[email protected]> 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);
