Browse Source

added leitzcloud location preset

Tobias Hagemann 1 year ago
parent
commit
fe3abcaaa8

+ 8 - 6
src/main/java/module-info.java

@@ -5,6 +5,7 @@ import org.cryptomator.common.locationpresets.DropboxWindowsLocationPresetsProvi
 import org.cryptomator.common.locationpresets.GoogleDriveLocationPresetsProvider;
 import org.cryptomator.common.locationpresets.ICloudMacLocationPresetsProvider;
 import org.cryptomator.common.locationpresets.ICloudWindowsLocationPresetsProvider;
+import org.cryptomator.common.locationpresets.LeitzcloudLocationPresetsProvider;
 import org.cryptomator.common.locationpresets.LocationPresetsProvider;
 import org.cryptomator.common.locationpresets.MegaLocationPresetsProvider;
 import org.cryptomator.common.locationpresets.OneDriveLinuxLocationPresetsProvider;
@@ -53,11 +54,12 @@ open module org.cryptomator.desktop {
 
 	provides TrayMenuController with AwtTrayMenuController;
 	provides Configurator with LogbackConfiguratorFactory;
-	provides LocationPresetsProvider with DropboxMacLocationPresetsProvider, //
-			DropboxWindowsLocationPresetsProvider, DropboxLinuxLocationPresetsProvider, //
-			ICloudMacLocationPresetsProvider, ICloudWindowsLocationPresetsProvider, //
+	provides LocationPresetsProvider with //
+			DropboxWindowsLocationPresetsProvider, DropboxMacLocationPresetsProvider, DropboxLinuxLocationPresetsProvider, //
 			GoogleDriveLocationPresetsProvider, //
-			PCloudLocationPresetsProvider, MegaLocationPresetsProvider, //
-			OneDriveLinuxLocationPresetsProvider, OneDriveWindowsLocationPresetsProvider, //
-			OneDriveMacLocationPresetsProvider;
+			ICloudWindowsLocationPresetsProvider, ICloudMacLocationPresetsProvider, //
+			LeitzcloudLocationPresetsProvider, //
+			MegaLocationPresetsProvider, //
+			OneDriveWindowsLocationPresetsProvider, OneDriveMacLocationPresetsProvider, OneDriveLinuxLocationPresetsProvider, //
+			PCloudLocationPresetsProvider;
 }

+ 30 - 0
src/main/java/org/cryptomator/common/locationpresets/LeitzcloudLocationPresetsProvider.java

@@ -0,0 +1,30 @@
+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(WINDOWS)
+@OperatingSystem(MAC)
+@CheckAvailability
+public final class LeitzcloudLocationPresetsProvider implements LocationPresetsProvider {
+
+	private static final Path LOCATION = LocationPresetsProvider.resolveLocation("~/leitzcloud");
+
+	@CheckAvailability
+	public static boolean isPresent() {
+		return Files.isDirectory(LOCATION);
+	}
+
+	@Override
+	public Stream<LocationPreset> getLocations() {
+		return Stream.of(new LocationPreset("leitzcloud", LOCATION));
+	}
+
+}