From 3e5a7fadd0bbfe4fa33baa5f1d23250b257591b4 Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Mon, 7 Nov 2022 15:55:26 +0100 Subject: [PATCH] only set the mount point when a mount point is explicitly required (didn't work for the webdav fallback provider, which doesn't _not_ MOUNT_TO_SYSTEM_CHOSEN_PATH, as it does not mount at all) --- .../java/org/cryptomator/common/vaults/Vault.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/cryptomator/common/vaults/Vault.java b/src/main/java/org/cryptomator/common/vaults/Vault.java index 3ae52acdf..e1ed7a1d8 100644 --- a/src/main/java/org/cryptomator/common/vaults/Vault.java +++ b/src/main/java/org/cryptomator/common/vaults/Vault.java @@ -161,11 +161,14 @@ public class Vault { } } - if (mountServiceImpl.hasCapability(MountCapability.MOUNT_TO_SYSTEM_CHOSEN_PATH) && vaultSettings.getMountPoint() == null) { - return builder; - } else { - return builder.setMountpoint(vaultSettings.getMountPoint()); + if (mountServiceImpl.hasCapability(MountCapability.MOUNT_TO_EXISTING_DIR) // + || mountServiceImpl.hasCapability(MountCapability.MOUNT_WITHIN_EXISTING_PARENT) // + || mountServiceImpl.hasCapability(MountCapability.MOUNT_AS_DRIVE_LETTER)) { + builder.setMountpoint(vaultSettings.getMountPoint()); } + + return builder; + } public synchronized void unlock(MasterkeyLoader keyLoader) throws CryptoException, IOException, MountFailedException { @@ -296,7 +299,7 @@ public class Vault { public String getAccessPoint() { var mountPoint = mount.get().mount.getMountpoint(); - if( mountPoint instanceof Mountpoint.WithPath m) { + if (mountPoint instanceof Mountpoint.WithPath m) { return m.path().toString(); } else { return mountPoint.uri().toString();