diff --git a/main/pom.xml b/main/pom.xml index ef45bb5f6..ce0fe40b0 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -26,7 +26,7 @@ 1.1.5 1.4.1 - 0.6.2 + 1.0.0 1.0.2 2.5 diff --git a/main/ui/src/main/java/org/cryptomator/ui/model/Vault.java b/main/ui/src/main/java/org/cryptomator/ui/model/Vault.java index 23c76429b..16ff849a1 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/model/Vault.java +++ b/main/ui/src/main/java/org/cryptomator/ui/model/Vault.java @@ -9,6 +9,8 @@ package org.cryptomator.ui.model; import java.io.IOException; +import java.net.InetAddress; +import java.net.UnknownHostException; import java.nio.file.DirectoryNotEmptyException; import java.nio.file.DirectoryStream; import java.nio.file.FileAlreadyExistsException; @@ -60,6 +62,7 @@ public class Vault { public static final Predicate NOT_LOCKED = hasState(State.LOCKED).negate(); private static final Logger LOG = LoggerFactory.getLogger(Vault.class); private static final String MASTERKEY_FILENAME = "masterkey.cryptomator"; + private static final String LOCALHOST_ALIAS = "cryptomator-vault"; private final Settings settings; private final VaultSettings vaultSettings; @@ -137,6 +140,7 @@ public class Vault { MountParams mountParams = MountParams.create() // .withWindowsDriveLetter(vaultSettings.winDriveLetter().get()) // .withPreferredGvfsScheme(settings.preferredGvfsScheme().get()) // + .withWebdavHostname(getLocalhostAliasOrNull()) // .build(); Platform.runLater(() -> { @@ -148,6 +152,19 @@ public class Vault { }); } + private String getLocalhostAliasOrNull() { + try { + InetAddress alias = InetAddress.getByName(LOCALHOST_ALIAS); + if (alias.getHostAddress().equals("127.0.0.1")) { + return LOCALHOST_ALIAS; + } else { + return null; + } + } catch (UnknownHostException e) { + return null; + } + } + public synchronized void unmount() throws CommandFailedException { unmount(Function.identity()); }