From 598bec305038d87803e5a35d3e748d88f1880ddc Mon Sep 17 00:00:00 2001 From: JaniruTEC Date: Mon, 12 Oct 2020 21:34:23 +0200 Subject: [PATCH] Finished feature: Fuse on Win Bumped required version of fuse-nio-adapter to 1.2.4 Added comments Changed log messages to be more descriptive --- .../mountpoint/TemporaryMountPointChooser.java | 13 ++++++++++--- main/pom.xml | 2 +- .../unlock/UnlockInvalidMountPointController.java | 1 + 3 files changed, 12 insertions(+), 4 deletions(-) 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 60991b97e..f9a01e028 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 @@ -69,13 +69,20 @@ public class TemporaryMountPointChooser implements MountPointChooser { try { switch (caller.getMountPointRequirement()) { case PARENT_NO_MOUNT_POINT -> { - Files.createDirectories(mountPoint.getParent()); - LOG.debug("Successfully created folder for mount point: {}", mountPoint); + //Create everything up to the parent (but not the actual mountpoint) + Path parent = mountPoint.getParent(); + Files.createDirectories(parent); + + //Get the name of the parent directory (#getFileName()) + //or just use the parent if the name is null (that's the case if parent is the root) + Path parentName = parent.getFileName() != null ? parent.getFileName() : parent; + LOG.debug("Successfully created/checked parent folder (\"{}\") for mount point: {}", parentName, mountPoint); return false; } case EMPTY_MOUNT_POINT -> { + //Create everything up to the mountpoint (including the actual mountpoint) Files.createDirectories(mountPoint); - LOG.debug("Successfully created mount point: {}", mountPoint); + LOG.debug("Successfully created/checked mount point: {}", mountPoint); return true; } case NONE -> { diff --git a/main/pom.xml b/main/pom.xml index 8702b89d9..d6e7fcadc 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -26,7 +26,7 @@ 1.9.12 2.2.3 - 1.2.3 + 1.2.4 1.1.15 1.0.12 diff --git a/main/ui/src/main/java/org/cryptomator/ui/unlock/UnlockInvalidMountPointController.java b/main/ui/src/main/java/org/cryptomator/ui/unlock/UnlockInvalidMountPointController.java index 7b0af6042..792edbf91 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/unlock/UnlockInvalidMountPointController.java +++ b/main/ui/src/main/java/org/cryptomator/ui/unlock/UnlockInvalidMountPointController.java @@ -12,6 +12,7 @@ import org.cryptomator.ui.common.FxmlScene; import javax.inject.Inject; +//At the current point in time only the CustomMountPointChooser may cause this window to be shown. @UnlockScoped public class UnlockInvalidMountPointController implements FxController {