From 98db82d13738e1f9bc510e9acf4af6ed1b004e38 Mon Sep 17 00:00:00 2001 From: Jan-Peter Klein Date: Wed, 9 Oct 2024 14:48:40 +0200 Subject: [PATCH] contains instead of stream --- .../GoogleDriveMacLocationPresetsProvider.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/cryptomator/common/locationpresets/GoogleDriveMacLocationPresetsProvider.java b/src/main/java/org/cryptomator/common/locationpresets/GoogleDriveMacLocationPresetsProvider.java index 6f4f13b4a..2bf952e82 100644 --- a/src/main/java/org/cryptomator/common/locationpresets/GoogleDriveMacLocationPresetsProvider.java +++ b/src/main/java/org/cryptomator/common/locationpresets/GoogleDriveMacLocationPresetsProvider.java @@ -106,7 +106,13 @@ public final class GoogleDriveMacLocationPresetsProvider implements LocationPres private Stream getPresetsFromAccountPath(Path accountPath) { try (var driveStream = Files.list(accountPath)) { List directories = StreamSupport.stream(driveStream.spliterator(), false).toList(); - return directories.stream().filter(preset -> MY_DRIVE_TRANSLATIONS.stream().anyMatch(translation -> preset.getFileName().toString().equalsIgnoreCase(translation))).map(drivePath -> new LocationPreset(getDriveLocationString(accountPath, drivePath), drivePath)); + return directories.stream() + .filter(preset -> MY_DRIVE_TRANSLATIONS + .contains(preset.getFileName().toString())) + .map(drivePath -> new LocationPreset( + getDriveLocationString(accountPath, drivePath), + drivePath + )); } catch (IOException e) { return Stream.empty(); }