Przeglądaj źródła

Revert 1554437884b0019a5b147c45215a568d9f18f121

Armin Schrenk 4 lat temu
rodzic
commit
f64144d1da

+ 1 - 1
main/commons/src/main/java/org/cryptomator/common/mountpoint/TemporaryMountPointChooser.java

@@ -46,7 +46,7 @@ public class TemporaryMountPointChooser implements MountPointChooser {
 	}
 
 	private Path choose(Path parent) {
-		String basename = this.vaultSettings.displayName().get();
+		String basename = this.vaultSettings.mountName().get();
 		//regular
 		Path mountPoint = parent.resolve(basename);
 		if (Files.notExists(mountPoint)) {

+ 4 - 4
main/commons/src/main/java/org/cryptomator/common/settings/VaultSettings.java

@@ -54,11 +54,11 @@ public class VaultSettings {
 	private final IntegerProperty filenameLengthLimit = new SimpleIntegerProperty(DEFAULT_FILENAME_LENGTH_LIMIT);
 	private final ObjectProperty<WhenUnlocked> actionAfterUnlock = new SimpleObjectProperty<>(DEFAULT_ACTION_AFTER_UNLOCK);
 
-	private final StringBinding normalizedDisplayName;
+	private final StringBinding mountName;
 
 	public VaultSettings(String id) {
 		this.id = Objects.requireNonNull(id);
-		this.normalizedDisplayName = Bindings.createStringBinding(this::normalizeDisplayName, displayName);
+		this.mountName = Bindings.createStringBinding(this::normalizeDisplayName, displayName);
 	}
 
 	Observable[] observables() {
@@ -107,8 +107,8 @@ public class VaultSettings {
 		return displayName;
 	}
 
-	public StringBinding normalizedDisplayName() {
-		return normalizedDisplayName;
+	public StringBinding mountName() {
+		return mountName;
 	}
 
 	public StringProperty winDriveLetter() {

+ 1 - 1
main/commons/src/main/java/org/cryptomator/common/vaults/DokanyVolume.java

@@ -44,7 +44,7 @@ public class DokanyVolume extends AbstractVolume {
 		this.mountPoint = determineMountPoint();
 		String mountName = vaultSettings.displayName().get();
 		try {
-			this.mount = mountFactory.mount(fs.getPath("/"), mountPoint, vaultSettings.displayName().get(), FS_TYPE_NAME, mountFlags.strip());
+			this.mount = mountFactory.mount(fs.getPath("/"), mountPoint, vaultSettings.mountName().get(), FS_TYPE_NAME, mountFlags.strip());
 		} catch (MountFailedException e) {
 			if (vaultSettings.getCustomMountPath().isPresent()) {
 				LOG.warn("Failed to mount vault into {}. Is this directory currently accessed by another process (e.g. Windows Explorer)?", mountPoint);

+ 3 - 4
main/commons/src/main/java/org/cryptomator/common/vaults/VaultModule.java

@@ -23,7 +23,6 @@ import javafx.beans.property.BooleanProperty;
 import javafx.beans.property.ObjectProperty;
 import javafx.beans.property.ReadOnlyBooleanProperty;
 import javafx.beans.property.SimpleObjectProperty;
-import javafx.beans.property.StringProperty;
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
@@ -76,7 +75,7 @@ public class VaultModule {
 	@DefaultMountFlags
 	public StringBinding provideDefaultMountFlags(Settings settings, VaultSettings vaultSettings) {
 		ObjectProperty<VolumeImpl> preferredVolumeImpl = settings.preferredVolumeImpl();
-		StringProperty mountName = vaultSettings.displayName();
+		StringBinding mountName = vaultSettings.mountName();
 		BooleanProperty readOnly = vaultSettings.usesReadOnlyMode();
 
 		return Bindings.createStringBinding(() -> {
@@ -96,7 +95,7 @@ public class VaultModule {
 	}
 
 	// see: https://github.com/osxfuse/osxfuse/wiki/Mount-options
-	private String getMacFuseDefaultMountFlags(StringProperty mountName, ReadOnlyBooleanProperty readOnly) {
+	private String getMacFuseDefaultMountFlags(StringBinding mountName, ReadOnlyBooleanProperty readOnly) {
 		assert SystemUtils.IS_OS_MAC_OSX;
 		StringBuilder flags = new StringBuilder();
 		if (readOnly.get()) {
@@ -148,7 +147,7 @@ public class VaultModule {
 	// see https://github.com/billziss-gh/winfsp/blob/5d0b10d0b643652c00ebb4704dc2bb28e7244973/src/dll/fuse/fuse_main.c#L53-L62 for syntax guide
 	// see https://github.com/billziss-gh/winfsp/blob/5d0b10d0b643652c00ebb4704dc2bb28e7244973/src/dll/fuse/fuse.c#L295-L319 for options (-o <...>)
 	// see https://github.com/billziss-gh/winfsp/wiki/Frequently-Asked-Questions/5ba00e4be4f5e938eaae6ef1500b331de12dee77 (FUSE 4.) on why the given defaults were choosen
-	private String getWindowsFuseDefaultMountFlags(StringProperty mountName, ReadOnlyBooleanProperty readOnly) {
+	private String getWindowsFuseDefaultMountFlags(StringBinding mountName, ReadOnlyBooleanProperty readOnly) {
 		assert SystemUtils.IS_OS_WINDOWS;
 		StringBuilder flags = new StringBuilder();
 

+ 1 - 1
main/commons/src/main/java/org/cryptomator/common/vaults/WebDavVolume.java

@@ -45,7 +45,7 @@ public class WebDavVolume implements Volume {
 		if (!server.isRunning()) {
 			server.start();
 		}
-		servlet = server.createWebDavServlet(fs.getPath("/"), vaultSettings.getId() + "/" + vaultSettings.normalizedDisplayName().get());
+		servlet = server.createWebDavServlet(fs.getPath("/"), vaultSettings.getId() + "/" + vaultSettings.mountName().get());
 		servlet.start();
 		mount();
 	}

+ 1 - 1
main/commons/src/test/java/org/cryptomator/common/vaults/VaultModuleTest.java

@@ -29,7 +29,7 @@ public class VaultModuleTest {
 
 	@BeforeEach
 	public void setup(@TempDir Path tmpDir) {
-		Mockito.when(vaultSettings.normalizedDisplayName()).thenReturn(Bindings.createStringBinding(() -> "TEST"));
+		Mockito.when(vaultSettings.mountName()).thenReturn(Bindings.createStringBinding(() -> "TEST"));
 		Mockito.when(vaultSettings.usesReadOnlyMode()).thenReturn(new SimpleBooleanProperty(true));
 		Mockito.when(vaultSettings.displayName()).thenReturn(new SimpleStringProperty("Vault"));
 		System.setProperty("user.home", tmpDir.toString());