|
@@ -2,7 +2,6 @@ package org.cryptomator.common.mountpoint;
|
|
|
|
|
|
import org.apache.commons.lang3.SystemUtils;
|
|
|
import org.cryptomator.common.Environment;
|
|
|
-import org.cryptomator.common.settings.VaultSettings;
|
|
|
import org.cryptomator.common.vaults.Vault;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
@@ -18,11 +17,11 @@ public class TemporaryMountPointChooser implements MountPointChooser {
|
|
|
private static final Logger LOG = LoggerFactory.getLogger(TemporaryMountPointChooser.class);
|
|
|
private static final int MAX_TMPMOUNTPOINT_CREATION_RETRIES = 10;
|
|
|
|
|
|
- private final VaultSettings vaultSettings;
|
|
|
+ private final Vault vault;
|
|
|
private final Environment environment;
|
|
|
|
|
|
public TemporaryMountPointChooser(Vault vault, Environment environment) {
|
|
|
- this.vaultSettings = vault.getVaultSettings();
|
|
|
+ this.vault = vault;
|
|
|
this.environment = environment;
|
|
|
}
|
|
|
|
|
@@ -39,7 +38,7 @@ public class TemporaryMountPointChooser implements MountPointChooser {
|
|
|
public Optional<Path> chooseMountPoint() {
|
|
|
//Shouldn't throw, but let's keep #orElseThrow in case we made a mistake and the check in #isApplicable failed
|
|
|
Path parent = this.environment.getMountPointsDir().orElseThrow();
|
|
|
- String basename = this.vaultSettings.getId();
|
|
|
+ String basename = this.vault.getVaultSettings().getId();
|
|
|
for (int i = 0; i < MAX_TMPMOUNTPOINT_CREATION_RETRIES; i++) {
|
|
|
Path mountPoint = parent.resolve(basename + "_" + i);
|
|
|
if (Files.notExists(mountPoint)) {
|