diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java index 2165a5f92..983d61dca 100644 --- a/src/main/java/module-info.java +++ b/src/main/java/module-info.java @@ -3,6 +3,7 @@ import org.cryptomator.common.locationpresets.DropboxLinuxLocationPresetsProvide import org.cryptomator.common.locationpresets.DropboxMacLocationPresetsProvider; import org.cryptomator.common.locationpresets.DropboxWindowsLocationPresetsProvider; import org.cryptomator.common.locationpresets.GoogleDriveLocationPresetsProvider; +import org.cryptomator.common.locationpresets.GoogleDriveMacLocationPresetsProvider; import org.cryptomator.common.locationpresets.ICloudMacLocationPresetsProvider; import org.cryptomator.common.locationpresets.ICloudWindowsLocationPresetsProvider; import org.cryptomator.common.locationpresets.LocationPresetsProvider; @@ -56,7 +57,8 @@ open module org.cryptomator.desktop { provides LocationPresetsProvider with DropboxMacLocationPresetsProvider, // DropboxWindowsLocationPresetsProvider, DropboxLinuxLocationPresetsProvider, // ICloudMacLocationPresetsProvider, ICloudWindowsLocationPresetsProvider, // - GoogleDriveLocationPresetsProvider, PCloudLocationPresetsProvider, MegaLocationPresetsProvider, // + GoogleDriveLocationPresetsProvider, GoogleDriveMacLocationPresetsProvider, // + PCloudLocationPresetsProvider, MegaLocationPresetsProvider, // OneDriveLinuxLocationPresetsProvider, OneDriveWindowsLocationPresetsProvider, // OneDriveMacLocationPresetsProvider; } \ No newline at end of file diff --git a/src/main/java/org/cryptomator/common/locationpresets/GoogleDriveLocationPresetsProvider.java b/src/main/java/org/cryptomator/common/locationpresets/GoogleDriveLocationPresetsProvider.java index d816445da..27eaa6b13 100644 --- a/src/main/java/org/cryptomator/common/locationpresets/GoogleDriveLocationPresetsProvider.java +++ b/src/main/java/org/cryptomator/common/locationpresets/GoogleDriveLocationPresetsProvider.java @@ -11,7 +11,6 @@ import static org.cryptomator.integrations.common.OperatingSystem.Value.MAC; import static org.cryptomator.integrations.common.OperatingSystem.Value.WINDOWS; @OperatingSystem(WINDOWS) -@OperatingSystem(MAC) @CheckAvailability public final class GoogleDriveLocationPresetsProvider implements LocationPresetsProvider { diff --git a/src/main/java/org/cryptomator/common/locationpresets/GoogleDriveMacLocationPresetsProvider.java b/src/main/java/org/cryptomator/common/locationpresets/GoogleDriveMacLocationPresetsProvider.java new file mode 100644 index 000000000..5a555033c --- /dev/null +++ b/src/main/java/org/cryptomator/common/locationpresets/GoogleDriveMacLocationPresetsProvider.java @@ -0,0 +1,29 @@ +package org.cryptomator.common.locationpresets; + +import org.cryptomator.integrations.common.CheckAvailability; +import org.cryptomator.integrations.common.OperatingSystem; + +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.stream.Stream; + +import static org.cryptomator.integrations.common.OperatingSystem.Value.MAC; +import static org.cryptomator.integrations.common.OperatingSystem.Value.WINDOWS; + +@OperatingSystem(MAC) +@CheckAvailability +public final class GoogleDriveMacLocationPresetsProvider implements LocationPresetsProvider { + + private static final Path LOCATION = LocationPresetsProvider.resolveLocation("~/Google Drive/My Drive"); + + + @CheckAvailability + public static boolean isPresent() { + return Files.isDirectory(LOCATION); + } + + @Override + public Stream getLocations() { + return Stream.of(new LocationPreset("Google Drive", LOCATION)); + } +}