This is an automated email from the ASF dual-hosted git repository.
reschke pushed a commit to branch OAK-11448
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git
The following commit(s) were added to refs/heads/OAK-11448 by this push:
new 89c0c4a45e OAK-11448: Remove usage of Guava Files.readLines()
89c0c4a45e is described below
commit 89c0c4a45e64ed29d3ac2ab8aa8cb0eaaa417a80
Author: Julian Reschke <[email protected]>
AuthorDate: Fri Jan 31 17:58:05 2025 +0100
OAK-11448: Remove usage of Guava Files.readLines()
---
.../oak/plugins/index/datastore/DataStoreTextWriter.java | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git
a/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/datastore/DataStoreTextWriter.java
b/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/datastore/DataStoreTextWriter.java
index d497275a0a..38394983c6 100644
---
a/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/datastore/DataStoreTextWriter.java
+++
b/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/datastore/DataStoreTextWriter.java
@@ -29,6 +29,7 @@ import java.nio.file.Files;
import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.Callable;
+import java.util.stream.Collectors;
import org.apache.commons.io.FileUtils;
import org.apache.jackrabbit.oak.api.Blob;
@@ -230,11 +231,11 @@ public class DataStoreTextWriter implements TextWriter,
Closeable, PreExtractedT
}
private Set<String> loadFromFile(File file) throws IOException {
- Set<String> result = new HashSet<>();
if (file.exists()) {
-
result.addAll(org.apache.jackrabbit.guava.common.io.Files.readLines(file,
StandardCharsets.UTF_8));
+ return Files.lines(file.toPath()).collect(Collectors.toSet());
+ } else {
+ return new HashSet<>();
}
- return result;
}
private void writeToFile(String fileName, Set<String> blobIds) throws
IOException {