support home-relative paths for cryptomator.keychainPath

This commit is contained in:
Sebastian Stenzel
2016-09-04 12:27:23 +02:00
parent c1611a12ed
commit 5c4bf2a207

View File

@@ -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;