瀏覽代碼

commit of the nioAdapter Interface, implementation enum and the commandFailedException

infeo 7 年之前
父節點
當前提交
1e7478a89f

+ 17 - 0
main/ui/src/main/java/org/cryptomator/ui/model/CommandFailedException.java

@@ -0,0 +1,17 @@
+package org.cryptomator.ui.model;
+
+public class CommandFailedException extends Exception {
+
+	public CommandFailedException(String message) {
+		super(message);
+	}
+
+	public CommandFailedException(Throwable cause) {
+		super(cause);
+	}
+
+	public CommandFailedException(String message, Throwable cause){
+		super(message,cause);
+	}
+
+}

+ 31 - 0
main/ui/src/main/java/org/cryptomator/ui/model/NioAdapter.java

@@ -0,0 +1,31 @@
+package org.cryptomator.ui.model;
+
+import org.cryptomator.cryptofs.CryptoFileSystem;
+
+import java.util.HashMap;
+
+
+public interface NioAdapter {
+
+	void unlock(CryptoFileSystem fs);
+
+	void mount() throws CommandFailedException;
+
+	void unmount() throws CommandFailedException;
+
+	void stop();
+
+	String getFilesystemRootUrl();
+
+	default boolean isSupported() {
+		return false;
+	}
+
+	default boolean supportsForcedUnmount() {
+		return false;
+	}
+
+	default void unmountForced() throws CommandFailedException {
+		throw new CommandFailedException("Operation not supported");
+	}
+}

+ 10 - 0
main/ui/src/main/java/org/cryptomator/ui/model/NioAdapterImpl.java

@@ -0,0 +1,10 @@
+package org.cryptomator.ui.model;
+
+import java.util.ArrayList;
+
+public enum NioAdapterImpl {
+
+	WEBDAV,
+	FUSE
+
+}