From b7f2fb0bdf1c979766c40f1820ffc1ff045ab170 Mon Sep 17 00:00:00 2001 From: JaniruTEC Date: Tue, 11 Aug 2020 23:35:05 +0200 Subject: [PATCH] Added cleanup to TemporaryMountPointChooser --- .../common/mountpoint/TemporaryMountPointChooser.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/main/commons/src/main/java/org/cryptomator/common/mountpoint/TemporaryMountPointChooser.java b/main/commons/src/main/java/org/cryptomator/common/mountpoint/TemporaryMountPointChooser.java index a1dec25ce..c28c9ce20 100644 --- a/main/commons/src/main/java/org/cryptomator/common/mountpoint/TemporaryMountPointChooser.java +++ b/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) { return new InvalidMountPointException(exception); }