diff --git a/pom.xml b/pom.xml index 2a541f1..d24a725 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.cryptomator fuse-nio-adapter - 1.2.7 + 1.2.8 FUSE-NIO-Adapter Access resources at a given NIO path via FUSE. https://github.com/cryptomator/fuse-nio-adapter diff --git a/src/main/java/org/cryptomator/frontend/fuse/mount/AbstractMount.java b/src/main/java/org/cryptomator/frontend/fuse/mount/AbstractMount.java index 33029fc..1c7a570 100644 --- a/src/main/java/org/cryptomator/frontend/fuse/mount/AbstractMount.java +++ b/src/main/java/org/cryptomator/frontend/fuse/mount/AbstractMount.java @@ -23,7 +23,7 @@ public Path getMountPoint() { } @Override - public void reveal(Revealer revealer) throws RevealException { + public void reveal(Revealer revealer) throws Exception { revealer.reveal(mountPoint); } diff --git a/src/main/java/org/cryptomator/frontend/fuse/mount/Mount.java b/src/main/java/org/cryptomator/frontend/fuse/mount/Mount.java index 885d905..ae29ae6 100644 --- a/src/main/java/org/cryptomator/frontend/fuse/mount/Mount.java +++ b/src/main/java/org/cryptomator/frontend/fuse/mount/Mount.java @@ -9,7 +9,7 @@ public interface Mount extends AutoCloseable { * * @param revealer Object containing necessary commands to show the Mount content to the user. */ - void reveal(Revealer revealer) throws RevealException; + void reveal(Revealer revealer) throws Exception; /** * Returns this Mount's mount point. diff --git a/src/main/java/org/cryptomator/frontend/fuse/mount/RevealException.java b/src/main/java/org/cryptomator/frontend/fuse/mount/RevealException.java deleted file mode 100644 index 82c02db..0000000 --- a/src/main/java/org/cryptomator/frontend/fuse/mount/RevealException.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.cryptomator.frontend.fuse.mount; - -public class RevealException extends Exception { - - public RevealException(String msg) { - super(msg); - } - - public RevealException(Throwable cause) { - super(cause); - } - - public RevealException(String msg, Throwable cause) { - super(msg, cause); - } -} diff --git a/src/main/java/org/cryptomator/frontend/fuse/mount/Revealer.java b/src/main/java/org/cryptomator/frontend/fuse/mount/Revealer.java index 57880c2..11e58e4 100644 --- a/src/main/java/org/cryptomator/frontend/fuse/mount/Revealer.java +++ b/src/main/java/org/cryptomator/frontend/fuse/mount/Revealer.java @@ -5,5 +5,5 @@ @FunctionalInterface public interface Revealer { - void reveal(Path path) throws RevealException; + void reveal(Path path) throws Exception; } diff --git a/src/test/java/org/cryptomator/frontend/fuse/mount/AwtFrameworkRevealer.java b/src/test/java/org/cryptomator/frontend/fuse/mount/AwtFrameworkRevealer.java index d5b59f3..ae43d99 100644 --- a/src/test/java/org/cryptomator/frontend/fuse/mount/AwtFrameworkRevealer.java +++ b/src/test/java/org/cryptomator/frontend/fuse/mount/AwtFrameworkRevealer.java @@ -7,15 +7,12 @@ public class AwtFrameworkRevealer implements Revealer { @Override - public void reveal(Path path) throws RevealException { + public void reveal(Path path) throws IOException, UnsupportedOperationException { if (Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.OPEN)) { - try { - Desktop.getDesktop().open(path.toFile()); - } catch (IOException e) { - throw new RevealException(e); - } + Desktop.getDesktop().open(path.toFile()); } else { - throw new RevealException("Desktop API to browse files not supported."); + throw new UnsupportedOperationException("Desktop API to browse files not supported."); } } + } diff --git a/src/test/java/org/cryptomator/frontend/fuse/mount/LinuxEnvironmentTest.java b/src/test/java/org/cryptomator/frontend/fuse/mount/LinuxEnvironmentTest.java index 7d52aa5..d483fbd 100644 --- a/src/test/java/org/cryptomator/frontend/fuse/mount/LinuxEnvironmentTest.java +++ b/src/test/java/org/cryptomator/frontend/fuse/mount/LinuxEnvironmentTest.java @@ -22,7 +22,7 @@ public static void main(String[] args) throws IOException { try (Mount mnt = mounter.mount(tmp, envVars)) { try { mnt.reveal(new AwtFrameworkRevealer()); - } catch (RevealException e) { + } catch (Exception e) { System.out.println("Reveal failed."); } System.out.println("Wait for it..."); diff --git a/src/test/java/org/cryptomator/frontend/fuse/mount/MirroringFuseMountTest.java b/src/test/java/org/cryptomator/frontend/fuse/mount/MirroringFuseMountTest.java index 6566196..e7ca656 100644 --- a/src/test/java/org/cryptomator/frontend/fuse/mount/MirroringFuseMountTest.java +++ b/src/test/java/org/cryptomator/frontend/fuse/mount/MirroringFuseMountTest.java @@ -186,7 +186,7 @@ private static void mount(Path pathToMirror, Path mountPoint) { LOG.info("Mounted successfully. Enter anything to stop the server..."); try { mnt.reveal(new AwtFrameworkRevealer()); - } catch (RevealException e) { + } catch (Exception e) { LOG.warn("Reveal failed.", e); } System.in.read();