mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-19 19:21:27 +00:00
Renamed NO_PARENT_NO_MOUNT_POINT to UNUSED_ROOT_DIR in MountPointRequirement
This commit is contained in:
@@ -56,7 +56,7 @@ class CustomMountPointChooser implements MountPointChooser {
|
||||
throw new InvalidMountPointException(new IllegalStateException("Illegal MountPointRequirement"));
|
||||
}
|
||||
default -> {
|
||||
//Currently the case for "NO_PARENT_NO_MOUNT_POINT, PARENT_OPT_MOUNT_POINT"
|
||||
//Currently the case for "UNUSED_ROOT_DIR, PARENT_OPT_MOUNT_POINT"
|
||||
throw new InvalidMountPointException(new IllegalStateException("Not implemented"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ class TemporaryMountPointChooser implements MountPointChooser {
|
||||
throw new InvalidMountPointException(new IllegalStateException("Illegal MountPointRequirement"));
|
||||
}
|
||||
default -> {
|
||||
//Currently the case for "NO_PARENT_NO_MOUNT_POINT, PARENT_OPT_MOUNT_POINT"
|
||||
//Currently the case for "UNUSED_ROOT_DIR, PARENT_OPT_MOUNT_POINT"
|
||||
throw new InvalidMountPointException(new IllegalStateException("Not implemented"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ public class DokanyVolume extends AbstractVolume {
|
||||
|
||||
@Override
|
||||
public MountPointRequirement getMountPointRequirement() {
|
||||
return this.vaultSettings.getWinDriveLetter().isPresent() ? MountPointRequirement.NO_PARENT_NO_MOUNT_POINT : MountPointRequirement.EMPTY_MOUNT_POINT;
|
||||
return this.vaultSettings.getWinDriveLetter().isPresent() ? MountPointRequirement.UNUSED_ROOT_DIR : MountPointRequirement.EMPTY_MOUNT_POINT;
|
||||
}
|
||||
|
||||
public static boolean isSupportedStatic() {
|
||||
|
||||
@@ -126,7 +126,7 @@ public class FuseVolume extends AbstractVolume {
|
||||
if (!SystemUtils.IS_OS_WINDOWS) {
|
||||
return MountPointRequirement.EMPTY_MOUNT_POINT;
|
||||
}
|
||||
return this.vaultSettings.getWinDriveLetter().isPresent() ? MountPointRequirement.NO_PARENT_NO_MOUNT_POINT : MountPointRequirement.PARENT_NO_MOUNT_POINT;
|
||||
return this.vaultSettings.getWinDriveLetter().isPresent() ? MountPointRequirement.UNUSED_ROOT_DIR : MountPointRequirement.PARENT_NO_MOUNT_POINT;
|
||||
}
|
||||
|
||||
public static boolean isSupportedStatic() {
|
||||
|
||||
@@ -9,7 +9,7 @@ public enum MountPointRequirement {
|
||||
/**
|
||||
* The Mountpoint needs to be a filesystem root and must not exist.
|
||||
*/
|
||||
NO_PARENT_NO_MOUNT_POINT,
|
||||
UNUSED_ROOT_DIR,
|
||||
|
||||
/**
|
||||
* No Mountpoint on the local filesystem required. (e.g. WebDAV)
|
||||
|
||||
@@ -42,14 +42,14 @@ public class UnlockInvalidMountPointController implements FxController {
|
||||
}
|
||||
|
||||
public boolean getDriveLetterOccupied() {
|
||||
return getMountPointRequirement() == MountPointRequirement.NO_PARENT_NO_MOUNT_POINT;
|
||||
return getMountPointRequirement() == MountPointRequirement.UNUSED_ROOT_DIR;
|
||||
}
|
||||
|
||||
private MountPointRequirement getMountPointRequirement() {
|
||||
var requirement = vault.getVolume().orElseThrow(() -> new IllegalStateException("Invalid Mountpoint without a Volume?!")).getMountPointRequirement();
|
||||
assert requirement != MountPointRequirement.NONE; //An invalid MountPoint with no required MountPoint doesn't seem sensible
|
||||
assert requirement != MountPointRequirement.PARENT_OPT_MOUNT_POINT; //Not implemented anywhere (yet)
|
||||
assert requirement != MountPointRequirement.NO_PARENT_NO_MOUNT_POINT || SystemUtils.IS_OS_WINDOWS; //Not implemented anywhere, but on Windows
|
||||
assert requirement != MountPointRequirement.UNUSED_ROOT_DIR || SystemUtils.IS_OS_WINDOWS; //Not implemented anywhere, but on Windows
|
||||
|
||||
return requirement;
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ public class UnlockWorkflow extends Task<Boolean> {
|
||||
var requirement = vault.getVolume().orElseThrow(() -> new IllegalStateException("Invalid Mountpoint without a Volume?!", impExc)).getMountPointRequirement();
|
||||
assert requirement != MountPointRequirement.NONE; //An invalid MountPoint with no required MountPoint doesn't seem sensible
|
||||
assert requirement != MountPointRequirement.PARENT_OPT_MOUNT_POINT; //Not implemented anywhere (yet)
|
||||
assert requirement != MountPointRequirement.NO_PARENT_NO_MOUNT_POINT || SystemUtils.IS_OS_WINDOWS; //Not implemented anywhere, but on Windows
|
||||
assert requirement != MountPointRequirement.UNUSED_ROOT_DIR || SystemUtils.IS_OS_WINDOWS; //Not implemented anywhere, but on Windows
|
||||
|
||||
Throwable cause = impExc.getCause();
|
||||
// TODO: apply https://openjdk.java.net/jeps/8213076 in future JDK versions
|
||||
@@ -95,7 +95,7 @@ public class UnlockWorkflow extends Task<Boolean> {
|
||||
}
|
||||
showInvalidMountPointScene();
|
||||
} else if (cause instanceof FileAlreadyExistsException) {
|
||||
if (requirement == MountPointRequirement.NO_PARENT_NO_MOUNT_POINT) {
|
||||
if (requirement == MountPointRequirement.UNUSED_ROOT_DIR) {
|
||||
LOG.error("Unlock failed. Drive Letter already in use: {}", cause.getMessage());
|
||||
} else {
|
||||
LOG.error("Unlock failed. Mountpoint already exists: {}", cause.getMessage());
|
||||
|
||||
Reference in New Issue
Block a user