From 1946fc6c0ed3447579c3c6db4dd804bfe7e4558b Mon Sep 17 00:00:00 2001 From: Jan-Peter Klein Date: Wed, 4 Sep 2024 15:05:24 +0200 Subject: [PATCH] filter hidden directories --- .../GoogleDriveMacLocationPresetsProvider.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/org/cryptomator/common/locationpresets/GoogleDriveMacLocationPresetsProvider.java b/src/main/java/org/cryptomator/common/locationpresets/GoogleDriveMacLocationPresetsProvider.java index ead1f86a0..509f41341 100644 --- a/src/main/java/org/cryptomator/common/locationpresets/GoogleDriveMacLocationPresetsProvider.java +++ b/src/main/java/org/cryptomator/common/locationpresets/GoogleDriveMacLocationPresetsProvider.java @@ -79,6 +79,13 @@ public final class GoogleDriveMacLocationPresetsProvider implements LocationPres try (var driveStream = Files.newDirectoryStream(accountPath, Files::isDirectory)) { List directories = StreamSupport.stream(driveStream.spliterator(), false).toList(); return directories.stream() + .filter(drivePath -> { + try { + return !Files.isHidden(drivePath); + } catch (IOException e) { + throw new RuntimeException(e); + } + }) .map(drivePath -> new LocationPreset(getDriveLocationString(accountPath, drivePath), drivePath)); } catch (IOException e) { return Stream.empty();