From 328f2f89a82ce87b3e192f8105968983fd9bb270 Mon Sep 17 00:00:00 2001 From: JaniruTEC <52893617+JaniruTEC@users.noreply.github.com> Date: Mon, 10 Jul 2023 16:01:39 +0200 Subject: [PATCH] Removed unnecessary checks --- .../common/mount/MountWithinParentUtil.java | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/main/java/org/cryptomator/common/mount/MountWithinParentUtil.java b/src/main/java/org/cryptomator/common/mount/MountWithinParentUtil.java index 2ec5ad862..3ce6d1c39 100644 --- a/src/main/java/org/cryptomator/common/mount/MountWithinParentUtil.java +++ b/src/main/java/org/cryptomator/common/mount/MountWithinParentUtil.java @@ -73,12 +73,9 @@ public final class MountWithinParentUtil { private static void removeResidualHideaway(Path hideaway) throws IOException { if (!Files.isDirectory(hideaway, LinkOption.NOFOLLOW_LINKS)) { - if (SystemUtils.IS_OS_WINDOWS) { - Files.setAttribute(hideaway, WIN_HIDDEN_ATTR, false); - } throw new MountPointPreparationException(new NotDirectoryException(hideaway.toString())); } - Files.delete(hideaway); + Files.delete(hideaway); //Fails if not empty } static void cleanup(Path mountPoint) { @@ -89,13 +86,6 @@ public final class MountWithinParentUtil { LOG.error("Unable to restore hidden directory to mountpoint \"{}\": Directory does not exist. (Deleted by user?)", mountPoint); return; } - if (!Files.isDirectory(hideaway, LinkOption.NOFOLLOW_LINKS)) { - LOG.error("Unable to restore hidden directory to mountpoint \"{}\": Not a directory.", mountPoint); - if (SystemUtils.IS_OS_WINDOWS) { - Files.setAttribute(hideaway, WIN_HIDDEN_ATTR, false); - } - return; - } Files.move(hideaway, mountPoint); if (SystemUtils.IS_OS_WINDOWS) {