commit of the nioAdapter Interface, implementation enum and the commandFailedException

This commit is contained in:
infeo
2018-02-03 16:43:33 +01:00
parent 8e1bb121bb
commit 1e7478a89f
3 changed files with 58 additions and 0 deletions
@@ -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);
}
}
@@ -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");
}
}
@@ -0,0 +1,10 @@
package org.cryptomator.ui.model;
import java.util.ArrayList;
public enum NioAdapterImpl {
WEBDAV,
FUSE
}