* 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:
Armin Schrenk
2020-11-03 12:50:52 +01:00
parent 1554437884
commit 3eb44b06af

View File

@@ -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;
}