From 4b359d98cbba858262fc33473d0cc1535edc9217 Mon Sep 17 00:00:00 2001 From: Jan-Peter Klein Date: Thu, 10 Oct 2024 17:39:53 +0200 Subject: [PATCH] removed unnecessary stream support --- .../GoogleDriveMacLocationPresetsProvider.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/cryptomator/common/locationpresets/GoogleDriveMacLocationPresetsProvider.java b/src/main/java/org/cryptomator/common/locationpresets/GoogleDriveMacLocationPresetsProvider.java index 88ac67707..7dd92279f 100644 --- a/src/main/java/org/cryptomator/common/locationpresets/GoogleDriveMacLocationPresetsProvider.java +++ b/src/main/java/org/cryptomator/common/locationpresets/GoogleDriveMacLocationPresetsProvider.java @@ -94,22 +94,19 @@ public final class GoogleDriveMacLocationPresetsProvider implements LocationPres *

* This method lists all directories within the provided {@code accountPath} and filters them * to identify folders whose names match any of the translations defined in {@code MY_DRIVE_TRANSLATIONS}. - *

- * Each matching folder is then converted into a {@code LocationPreset} object. * * @param accountPath the root path of the Google Drive account to scan. * @return a stream of {@code LocationPreset} objects representing matching directories. */ private Stream getPresetsFromAccountPath(Path accountPath) { try (var driveStream = Files.list(accountPath)) { - List directories = StreamSupport.stream(driveStream.spliterator(), false).toList(); - return directories.stream() + return driveStream .filter(preset -> MY_DRIVE_TRANSLATIONS .contains(preset.getFileName().toString())) .map(drivePath -> new LocationPreset( getDriveLocationString(accountPath), drivePath - )); + )).toList().stream(); } catch (IOException e) { return Stream.empty(); }