From 5c4bf2a207add4aeb9ccc94f2287dc69c1c5dd76 Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Sun, 4 Sep 2016 12:27:23 +0200 Subject: [PATCH] support home-relative paths for cryptomator.keychainPath --- .../keychain/WindowsProtectedKeychainAccess.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main/keychain/src/main/java/org/cryptomator/keychain/WindowsProtectedKeychainAccess.java b/main/keychain/src/main/java/org/cryptomator/keychain/WindowsProtectedKeychainAccess.java index 205772d15..a0ced12eb 100644 --- a/main/keychain/src/main/java/org/cryptomator/keychain/WindowsProtectedKeychainAccess.java +++ b/main/keychain/src/main/java/org/cryptomator/keychain/WindowsProtectedKeychainAccess.java @@ -64,11 +64,14 @@ class WindowsProtectedKeychainAccess implements KeychainAccessStrategy { } else { this.dataProtection = null; } - final String keychainPathProperty = System.getProperty("cryptomator.keychainPath"); + String keychainPathProperty = System.getProperty("cryptomator.keychainPath"); if (dataProtection != null && keychainPathProperty == null) { - LOG.warn("Windows DataProtection module loaded, but no keychainPath configured."); + LOG.warn("Windows DataProtection module loaded, but no cryptomator.keychainPath property found."); } if (keychainPathProperty != null) { + if (keychainPathProperty.startsWith("~/")) { + keychainPathProperty = SystemUtils.USER_HOME + keychainPathProperty.substring(1); + } this.keychainPath = FileSystems.getDefault().getPath(keychainPathProperty); } else { this.keychainPath = null;