浏览代码

Added cleanup to TemporaryMountPointChooser

JaniruTEC 4 年之前
父节点
当前提交
b7f2fb0bdf

+ 10 - 0
main/commons/src/main/java/org/cryptomator/common/mountpoint/TemporaryMountPointChooser.java

@@ -73,6 +73,16 @@ public class TemporaryMountPointChooser implements MountPointChooser {
 		}
 		}
 	}
 	}
 
 
+	@Override
+	public void cleanup(Path mountPoint) {
+		try {
+			Files.delete(mountPoint);
+			LOG.debug("Successfully deleted mount point: {}", mountPoint);
+		} catch (IOException e) {
+			LOG.warn("Could not delete mount point: {}", e.getMessage());
+		}
+	}
+
 	private InvalidMountPointException wrapAsIMPE(Exception exception) {
 	private InvalidMountPointException wrapAsIMPE(Exception exception) {
 		return new InvalidMountPointException(exception);
 		return new InvalidMountPointException(exception);
 	}
 	}