mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-20 11:41:26 +00:00
Fixes #1061:
* temp mount point is first tried without any addition * then with id Suffix in brackets * then with underscores, id suffix and count
This commit is contained in:
@@ -47,8 +47,19 @@ public class TemporaryMountPointChooser implements MountPointChooser {
|
||||
|
||||
private Path choose(Path parent) {
|
||||
String basename = this.vaultSettings.displayName().get();
|
||||
for (int i = 0; i < MAX_TMPMOUNTPOINT_CREATION_RETRIES; i++) {
|
||||
Path mountPoint = parent.resolve(basename + "_" + i);
|
||||
//regular
|
||||
Path mountPoint = parent.resolve(basename);
|
||||
if (Files.notExists(mountPoint)) {
|
||||
return mountPoint;
|
||||
}
|
||||
//with id
|
||||
mountPoint = parent.resolve(basename + " (" +vaultSettings.getId() + ")");
|
||||
if (Files.notExists(mountPoint)) {
|
||||
return mountPoint;
|
||||
}
|
||||
//with id and count
|
||||
for (int i = 1; i < MAX_TMPMOUNTPOINT_CREATION_RETRIES; i++) {
|
||||
mountPoint = parent.resolve(basename + "_(" +vaultSettings.getId() + ")_"+i);
|
||||
if (Files.notExists(mountPoint)) {
|
||||
return mountPoint;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user