Skip to content

Commit e619e53

Browse files
authored
OAK-11440: Remove usage of Guava Files.touch() (#2035)
1 parent 7fe4983 commit e619e53

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

oak-blob-plugins/src/main/java/org/apache/jackrabbit/oak/plugins/blob/UploadStagingCache.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
import java.io.File;
2323
import java.io.IOException;
2424
import java.io.UncheckedIOException;
25+
import java.nio.file.Files;
2526
import java.nio.file.Path;
27+
import java.nio.file.attribute.FileTime;
2628
import java.util.ArrayList;
2729
import java.util.Collections;
2830
import java.util.Iterator;
@@ -40,7 +42,6 @@
4042
import java.util.stream.Stream;
4143

4244
import org.apache.jackrabbit.guava.common.cache.Weigher;
43-
import org.apache.jackrabbit.guava.common.io.Files;
4445
import org.apache.jackrabbit.guava.common.util.concurrent.FutureCallback;
4546
import org.apache.jackrabbit.guava.common.util.concurrent.Futures;
4647
import org.apache.jackrabbit.guava.common.util.concurrent.ListenableFuture;
@@ -384,7 +385,7 @@ private SettableFuture<Integer> stage(final String id, final File upload) {
384385
// Add the uploaded file to the download cache if available
385386
if (downloadCache != null) {
386387
// Touch the file to update timestamp and record length
387-
Files.touch(upload);
388+
Files.setLastModifiedTime(upload.toPath(), FileTime.fromMillis(System.currentTimeMillis()));
388389
downloadCache.put(id, upload);
389390

390391
LOG.debug("[{}] added to cache", id);

0 commit comments

Comments
 (0)