From 28a7e4aa5cae3dd2ba37ec95e333a9e8ccc4a59f Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Mon, 31 Jul 2023 15:23:06 +0200 Subject: [PATCH] use JVM path separator in keychain pahts propertey --- README.md | 2 +- .../windows/keychain/WindowsProtectedKeychainAccess.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b90d29f..fd40c21 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Windows-specific implementations of [integrations-api](https://github.com/crypto This project uses the following JVM properties: * `cryptomator.integrationsWin.autoStartShellLinkName` - Name of the shell link, which is placed in the Windows startup folder to start application on user login -* `cryptomator.integrationsWin.keychainPaths` - Colon separated list of paths, which are checked for encrypted data +* `cryptomator.integrationsWin.keychainPaths` - List of file paths, which are checked for data encrypted with the Windows data protection api ## Building diff --git a/src/main/java/org/cryptomator/windows/keychain/WindowsProtectedKeychainAccess.java b/src/main/java/org/cryptomator/windows/keychain/WindowsProtectedKeychainAccess.java index 44bb532..ad4aee0 100644 --- a/src/main/java/org/cryptomator/windows/keychain/WindowsProtectedKeychainAccess.java +++ b/src/main/java/org/cryptomator/windows/keychain/WindowsProtectedKeychainAccess.java @@ -39,7 +39,7 @@ /** * Windows implementation for the {@link KeychainAccessProvider} based on the data protection API. - * The storage locations to check for encrypted data can be set with the JVM property {@value KEYCHAIN_PATHS_PROPERTY} as a colon({@value PATH_LIST_SEP}) separated list of paths. + * The storage locations to check for encrypted data can be set with the JVM property {@value KEYCHAIN_PATHS_PROPERTY} with the paths seperated with the character defined in the JVM property path.separator. */ @Priority(1000) @OperatingSystem(OperatingSystem.Value.WINDOWS) @@ -73,7 +73,7 @@ public WindowsProtectedKeychainAccess() { private static List readKeychainPathsFromEnv() { return Optional.ofNullable(System.getProperty(KEYCHAIN_PATHS_PROPERTY)) - .stream().flatMap(rawPaths -> Arrays.stream(rawPaths.split(PATH_LIST_SEP))) + .stream().flatMap(rawPaths -> Arrays.stream(rawPaths.split(System.getProperty("path.separator")))) .filter(Predicate.not(String::isEmpty)) .map(Path::of) .map(WindowsProtectedKeychainAccess::resolveHomeDir)