mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-08-19 05:36:02 +00:00
code refinements
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
package org.cryptomator.ui.model;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
import org.cryptomator.common.settings.VaultSettings;
|
||||
import org.cryptomator.cryptofs.CryptoFileSystem;
|
||||
import org.cryptomator.frontend.dokany.Mount;
|
||||
@@ -28,7 +29,7 @@ public class DokanyVolume implements Volume {
|
||||
|
||||
@Override
|
||||
public boolean isSupported() {
|
||||
return this.isSupportedStatic();
|
||||
return DokanyVolume.isSupportedStatic();
|
||||
}
|
||||
|
||||
//TODO: Drive letter 'A' as mount point is invalid in dokany. maybe we should do already here something against it
|
||||
@@ -39,15 +40,10 @@ public class DokanyVolume implements Volume {
|
||||
driveLetter = vaultSettings.winDriveLetter().get().charAt(0);
|
||||
} else {
|
||||
//auto assign drive letter
|
||||
//TODO: can we assume the we have at least one free drive letter?
|
||||
|
||||
//this is a temporary fix for 'A' being an invalid drive letter
|
||||
if (!windowsDriveLetters.getAvailableDriveLetters().isEmpty()) {
|
||||
Iterator<Character> winDriveLetterIt = windowsDriveLetters.getAvailableDriveLetters().iterator();
|
||||
do {
|
||||
driveLetter = winDriveLetterIt.next();
|
||||
} while (winDriveLetterIt.hasNext() && driveLetter == 65);
|
||||
// if (!windowsDriveLetters.getAvailableDriveLetters().isEmpty()) {
|
||||
//this is a temporary fix for 'A' being an invalid drive letter
|
||||
Set<Character> availableLettersWithoutA = Sets.difference(windowsDriveLetters.getAvailableDriveLetters(), Set.of('A'));
|
||||
driveLetter = availableLettersWithoutA.iterator().next();
|
||||
// driveLetter = windowsDriveLetters.getAvailableDriveLetters().iterator().next();
|
||||
} else {
|
||||
throw new VolumeException("No free drive letter available.");
|
||||
|
||||
@@ -118,7 +118,7 @@ public class FuseVolume implements Volume {
|
||||
|
||||
@Override
|
||||
public boolean isSupported() {
|
||||
return this.isSupportedStatic();
|
||||
return FuseVolume.isSupportedStatic();
|
||||
}
|
||||
|
||||
public static boolean isSupportedStatic() {
|
||||
|
||||
@@ -116,7 +116,7 @@ public class WebDavVolume implements Volume {
|
||||
|
||||
@Override
|
||||
public boolean isSupported() {
|
||||
return this.isSupportedStatic();
|
||||
return WebDavVolume.isSupportedStatic();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user