mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-20 11:41:26 +00:00
reformatting & removing unused imports
This commit is contained in:
@@ -10,8 +10,8 @@ public class CommandFailedException extends Exception {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
public CommandFailedException(String message, Throwable cause){
|
||||
super(message,cause);
|
||||
public CommandFailedException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,9 +2,6 @@ package org.cryptomator.ui.model;
|
||||
|
||||
import org.cryptomator.cryptofs.CryptoFileSystem;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
|
||||
public interface NioAdapter {
|
||||
|
||||
void unlock(CryptoFileSystem fs);
|
||||
@@ -13,6 +10,10 @@ public interface NioAdapter {
|
||||
|
||||
void unmount() throws CommandFailedException;
|
||||
|
||||
default void unmountForced() throws CommandFailedException {
|
||||
throw new CommandFailedException("Operation not supported");
|
||||
}
|
||||
|
||||
void stop();
|
||||
|
||||
String getFilesystemRootUrl();
|
||||
@@ -25,7 +26,4 @@ public interface NioAdapter {
|
||||
return false;
|
||||
}
|
||||
|
||||
default void unmountForced() throws CommandFailedException {
|
||||
throw new CommandFailedException("Operation not supported");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@ import org.cryptomator.frontend.webdav.servlet.WebDavServletController;
|
||||
import javax.inject.Inject;
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.function.Function;
|
||||
|
||||
@VaultModule.PerVault
|
||||
public class WebDavNioAdapter implements NioAdapter {
|
||||
@@ -27,18 +26,18 @@ public class WebDavNioAdapter implements NioAdapter {
|
||||
private Mounter.Mount mount;
|
||||
|
||||
@Inject
|
||||
public WebDavNioAdapter(WebDavServer server, VaultSettings vaultSettings, Settings settings){
|
||||
public WebDavNioAdapter(WebDavServer server, VaultSettings vaultSettings, Settings settings) {
|
||||
this.server = server;
|
||||
this.vaultSettings = vaultSettings;
|
||||
this.settings = settings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unlock(CryptoFileSystem fs){
|
||||
if(!server.isRunning()){
|
||||
public void unlock(CryptoFileSystem fs) {
|
||||
if (!server.isRunning()) {
|
||||
server.start();
|
||||
}
|
||||
servlet = server.createWebDavServlet(fs.getPath("/"), vaultSettings.getId()+ "/" + vaultSettings.mountName().get());
|
||||
servlet = server.createWebDavServlet(fs.getPath("/"), vaultSettings.getId() + "/" + vaultSettings.mountName().get());
|
||||
servlet.start();
|
||||
}
|
||||
|
||||
@@ -64,14 +63,13 @@ public class WebDavNioAdapter implements NioAdapter {
|
||||
public synchronized void unmount() throws CommandFailedException {
|
||||
try {
|
||||
mount.unmount();
|
||||
}
|
||||
catch (Mounter.CommandFailedException e){
|
||||
} catch (Mounter.CommandFailedException e) {
|
||||
throw new CommandFailedException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void unmountForced(){
|
||||
public synchronized void unmountForced() {
|
||||
mount.forced();
|
||||
}
|
||||
|
||||
@@ -90,7 +88,7 @@ public class WebDavNioAdapter implements NioAdapter {
|
||||
|
||||
@Override
|
||||
public void stop() {
|
||||
if(servlet != null){
|
||||
if (servlet != null) {
|
||||
servlet.stop();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user