Przeglądaj źródła

Readd mac specifc google drive location provider

Armin Schrenk 1 rok temu
rodzic
commit
179240b325

+ 3 - 1
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;
 }

+ 0 - 1
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 {
 

+ 29 - 0
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<LocationPreset> getLocations() {
+		return Stream.of(new LocationPreset("Google Drive", LOCATION));
+	}
+}