From 89774406974f07f8d371672dcef8cdbe43dbc785 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Thu, 21 Jan 2021 15:29:04 +0100 Subject: [PATCH] Rename RevealerFacade to Revealer --- .../java/org/cryptomator/common/vaults/DokanyVolume.java | 2 +- .../java/org/cryptomator/common/vaults/FuseVolume.java | 2 +- .../main/java/org/cryptomator/common/vaults/Vault.java | 2 +- .../main/java/org/cryptomator/common/vaults/Volume.java | 4 ++-- .../java/org/cryptomator/common/vaults/WebDavVolume.java | 2 +- .../java/org/cryptomator/ui/common/VaultService.java | 9 ++++----- .../org/cryptomator/ui/traymenu/TrayMenuController.java | 4 ++-- .../java/org/cryptomator/ui/traymenu/TrayMenuModule.java | 2 +- 8 files changed, 13 insertions(+), 14 deletions(-) diff --git a/main/commons/src/main/java/org/cryptomator/common/vaults/DokanyVolume.java b/main/commons/src/main/java/org/cryptomator/common/vaults/DokanyVolume.java index e51d50fd3..a33dbd5ee 100644 --- a/main/commons/src/main/java/org/cryptomator/common/vaults/DokanyVolume.java +++ b/main/commons/src/main/java/org/cryptomator/common/vaults/DokanyVolume.java @@ -52,7 +52,7 @@ public class DokanyVolume extends AbstractVolume { } @Override - public void reveal(RevealerFacade revealer) throws VolumeException { + public void reveal(Revealer revealer) throws VolumeException { try { mount.reveal(revealer::reveal); } catch (Exception e) { diff --git a/main/commons/src/main/java/org/cryptomator/common/vaults/FuseVolume.java b/main/commons/src/main/java/org/cryptomator/common/vaults/FuseVolume.java index b8d3b650d..5400f8ff2 100644 --- a/main/commons/src/main/java/org/cryptomator/common/vaults/FuseVolume.java +++ b/main/commons/src/main/java/org/cryptomator/common/vaults/FuseVolume.java @@ -72,7 +72,7 @@ public class FuseVolume extends AbstractVolume { } @Override - public void reveal(RevealerFacade revealer) throws VolumeException { + public void reveal(Revealer revealer) throws VolumeException { try { mount.reveal(revealer::reveal); } catch (Exception e) { diff --git a/main/commons/src/main/java/org/cryptomator/common/vaults/Vault.java b/main/commons/src/main/java/org/cryptomator/common/vaults/Vault.java index fd301c3bd..adf39c6f2 100644 --- a/main/commons/src/main/java/org/cryptomator/common/vaults/Vault.java +++ b/main/commons/src/main/java/org/cryptomator/common/vaults/Vault.java @@ -148,7 +148,7 @@ public class Vault { } } - public void reveal(Volume.RevealerFacade vaultRevealer) throws VolumeException { + public void reveal(Volume.Revealer vaultRevealer) throws VolumeException { volume.reveal(vaultRevealer); } diff --git a/main/commons/src/main/java/org/cryptomator/common/vaults/Volume.java b/main/commons/src/main/java/org/cryptomator/common/vaults/Volume.java index bf59423b4..74a307d5a 100644 --- a/main/commons/src/main/java/org/cryptomator/common/vaults/Volume.java +++ b/main/commons/src/main/java/org/cryptomator/common/vaults/Volume.java @@ -42,7 +42,7 @@ public interface Volume { * @param revealer An object capable of revealing the location of the mounted vault to view the content (e.g. in the default file browser). * @throws VolumeException */ - void reveal(RevealerFacade revealer) throws VolumeException; + void reveal(Revealer revealer) throws VolumeException; void unmount() throws VolumeException; @@ -91,7 +91,7 @@ public interface Volume { * Hides and unifies the different Revealer implementations in the different nio-adapters. */ @FunctionalInterface - interface RevealerFacade { + interface Revealer { void reveal(Path p) throws VolumeException; diff --git a/main/commons/src/main/java/org/cryptomator/common/vaults/WebDavVolume.java b/main/commons/src/main/java/org/cryptomator/common/vaults/WebDavVolume.java index 312098303..072851272 100644 --- a/main/commons/src/main/java/org/cryptomator/common/vaults/WebDavVolume.java +++ b/main/commons/src/main/java/org/cryptomator/common/vaults/WebDavVolume.java @@ -73,7 +73,7 @@ public class WebDavVolume implements Volume { } @Override - public void reveal(RevealerFacade revealer) throws VolumeException { + public void reveal(Revealer revealer) throws VolumeException { try { mount.reveal(revealer::reveal); } catch (Exception e) { diff --git a/main/ui/src/main/java/org/cryptomator/ui/common/VaultService.java b/main/ui/src/main/java/org/cryptomator/ui/common/VaultService.java index 4baa9526c..775b953bb 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/common/VaultService.java +++ b/main/ui/src/main/java/org/cryptomator/ui/common/VaultService.java @@ -15,7 +15,6 @@ import java.util.Iterator; import java.util.List; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; -import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; @FxApplicationScoped @@ -30,7 +29,7 @@ public class VaultService { this.executorService = executorService; } - public void reveal(Vault vault, Volume.RevealerFacade vaultRevealCmd) { + public void reveal(Vault vault, Volume.Revealer vaultRevealCmd) { executorService.execute(createRevealTask(vault, vaultRevealCmd)); } @@ -39,7 +38,7 @@ public class VaultService { * * @param vault The vault to reveal */ - public Task createRevealTask(Vault vault, Volume.RevealerFacade vaultRevealCmd) { + public Task createRevealTask(Vault vault, Volume.Revealer vaultRevealCmd) { Task task = new RevealVaultTask(vault, vaultRevealCmd); task.setOnSucceeded(evt -> LOG.info("Revealed {}", vault.getDisplayName())); task.setOnFailed(evt -> LOG.error("Failed to reveal " + vault.getDisplayName(), evt.getSource().getException())); @@ -100,13 +99,13 @@ public class VaultService { private static class RevealVaultTask extends Task { private final Vault vault; - private final Volume.RevealerFacade revealer; + private final Volume.Revealer revealer; /** * @param vault The vault to lock * @param revealer The object to use to show the vault content to the user. */ - public RevealVaultTask(Vault vault, Volume.RevealerFacade revealer) { + public RevealVaultTask(Vault vault, Volume.Revealer revealer) { this.vault = vault; this.revealer = revealer; diff --git a/main/ui/src/main/java/org/cryptomator/ui/traymenu/TrayMenuController.java b/main/ui/src/main/java/org/cryptomator/ui/traymenu/TrayMenuController.java index fada2b061..9d45b1b68 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/traymenu/TrayMenuController.java +++ b/main/ui/src/main/java/org/cryptomator/ui/traymenu/TrayMenuController.java @@ -28,11 +28,11 @@ class TrayMenuController { private final AppLifecycleListener appLifecycle; private final FxApplicationStarter fxApplicationStarter; private final ObservableList vaults; - private final Volume.RevealerFacade revealer; + private final Volume.Revealer revealer; private final PopupMenu menu; @Inject - TrayMenuController(ResourceBundle resourceBundle, AppLifecycleListener appLifecycle, FxApplicationStarter fxApplicationStarter, ObservableList vaults, Volume.RevealerFacade revealer) { + TrayMenuController(ResourceBundle resourceBundle, AppLifecycleListener appLifecycle, FxApplicationStarter fxApplicationStarter, ObservableList vaults, Volume.Revealer revealer) { this.resourceBundle = resourceBundle; this.appLifecycle = appLifecycle; this.fxApplicationStarter = fxApplicationStarter; diff --git a/main/ui/src/main/java/org/cryptomator/ui/traymenu/TrayMenuModule.java b/main/ui/src/main/java/org/cryptomator/ui/traymenu/TrayMenuModule.java index 65227a880..99cf3d441 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/traymenu/TrayMenuModule.java +++ b/main/ui/src/main/java/org/cryptomator/ui/traymenu/TrayMenuModule.java @@ -11,7 +11,7 @@ import java.io.IOException; abstract class TrayMenuModule { @Provides - static Volume.RevealerFacade provideAwtRevealer(){ + static Volume.Revealer provideAwtRevealer(){ return p -> { if (Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.OPEN)) { try {