Pārlūkot izejas kodu

revert 1ab73be1f44af0541d2a96a6a4d7b7b86cf42b21 and 2d968eac8c6fa714818b57bc0689dc80beba86b9

Armin Schrenk 1 gadu atpakaļ
vecāks
revīzija
11ba1f3ddc

+ 1 - 10
src/main/java/org/cryptomator/common/mount/Mounter.java

@@ -119,9 +119,8 @@ public class Mounter {
 					Files.createDirectories(defaultMountPointBase);
 					builder.setMountpoint(defaultMountPointBase);
 				} else if (canMountToDir) {
-					var mountPoint = defaultMountPointBase.resolve(vaultSettings.id);
+					var mountPoint = defaultMountPointBase.resolve(vaultSettings.mountName.get());
 					Files.createDirectories(mountPoint);
-					cleanup = () -> removeCreatedDirectory(mountPoint);
 					builder.setMountpoint(mountPoint);
 				}
 			} else {
@@ -157,14 +156,6 @@ public class Mounter {
 
 	}
 
-	private void removeCreatedDirectory(Path toDelete) {
-		try {
-			Files.delete(toDelete);
-		} catch (IOException e) {
-			LOG.warn("Unable to remove {} after unmount: {}.", toDelete, e.getMessage());
-		}
-	}
-
 	public MountHandle mount(VaultSettings vaultSettings, Path cryptoFsRoot) throws IOException, MountFailedException {
 		var mountService = mountProviders.stream().filter(s -> s.getClass().getName().equals(vaultSettings.mountService.getValue())).findFirst().orElse(defaultMountService.getValue());