mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-18 18:51:26 +00:00
Added check for deletion of hideaway
This commit is contained in:
@@ -72,12 +72,24 @@ public final class MountWithinParentUtil {
|
||||
Path hideaway = getHideaway(mountPoint);
|
||||
try {
|
||||
waitForMountpointRestoration(mountPoint);
|
||||
if (Files.notExists(hideaway, LinkOption.NOFOLLOW_LINKS)) {
|
||||
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) {
|
||||
Files.setAttribute(mountPoint, WIN_HIDDEN_ATTR, false);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
LOG.error("Unable to restore hidden directory to mountpoint {}.", mountPoint, e);
|
||||
LOG.error("Unable to restore hidden directory to mountpoint \"{}\".", mountPoint, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user