Skip to content

Commit

Permalink
Show a dedicated message when mounting to an occupied Windows drive
Browse files Browse the repository at this point in the history
Fixes #2309.
  • Loading branch information
sschuberth committed Jun 16, 2023
1 parent 5d796ef commit b564f7a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/org/cryptomator/common/mount/Mounter.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ private Runnable prepareMountPoint() throws IOException {
}
} else {
var mpIsDriveLetter = userChosenMountPoint.toString().matches("[A-Z]:\\\\");
if (!mpIsDriveLetter && canMountToParent && !canMountToDir) {
if (mpIsDriveLetter) {
if (driveLetters.getOccupied().contains(userChosenMountPoint)) throw new IllegalMountPointException("Drive \"" + userChosenMountPoint + "\" is already occupied.");
} else if (canMountToParent && !canMountToDir) {
MountWithinParentUtil.prepareParentNoMountPoint(userChosenMountPoint);
cleanup = () -> {
MountWithinParentUtil.cleanup(userChosenMountPoint);
Expand Down

0 comments on commit b564f7a

Please sign in to comment.