From c30a28aae0907157ae0d9ed6767df4bf188f222f Mon Sep 17 00:00:00 2001 From: Jan-Peter Klein Date: Mon, 16 Jun 2025 14:37:17 +0200 Subject: [PATCH] Files.createTempDirectory instead of Files.createDirectory --- .../common/recovery/RecoveryDirectory.java | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/main/java/org/cryptomator/common/recovery/RecoveryDirectory.java b/src/main/java/org/cryptomator/common/recovery/RecoveryDirectory.java index 953708535..c1f82e762 100644 --- a/src/main/java/org/cryptomator/common/recovery/RecoveryDirectory.java +++ b/src/main/java/org/cryptomator/common/recovery/RecoveryDirectory.java @@ -19,20 +19,14 @@ public final class RecoveryDirectory implements AutoCloseable { private final Path recoveryPath; private final Path vaultPath; - - private static Path addR(Path p){ - return p.resolve("r"); - } - - private RecoveryDirectory(Path vaultPath) { + private RecoveryDirectory(Path vaultPath, Path recoveryPath) { this.vaultPath = vaultPath; - this.recoveryPath = addR(vaultPath); + this.recoveryPath = recoveryPath; } public static RecoveryDirectory create(Path vaultPath) throws IOException { - Path recovery = addR(vaultPath); - Files.createDirectory(recovery); - return new RecoveryDirectory(vaultPath); + Path tempDir = Files.createTempDirectory("r"); + return new RecoveryDirectory(vaultPath, tempDir); } public void moveRecoveredFiles() throws IOException {