Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import org.cryptomator.integrations.mount.MountService;
import org.cryptomator.integrations.revealpath.RevealPathService;
import org.cryptomator.integrations.tray.TrayMenuController;
import org.cryptomator.integrations.autostart.AutoStartProvider;
import org.cryptomator.integrations.keychain.KeychainAccessProvider;
Expand All @@ -14,12 +15,14 @@
exports org.cryptomator.integrations.common;
exports org.cryptomator.integrations.keychain;
exports org.cryptomator.integrations.mount;
exports org.cryptomator.integrations.revealpath;
exports org.cryptomator.integrations.tray;
exports org.cryptomator.integrations.uiappearance;

uses AutoStartProvider;
uses KeychainAccessProvider;
uses MountService;
uses RevealPathService;
uses TrayIntegrationProvider;
uses TrayMenuController;
uses UiAppearanceProvider;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package org.cryptomator.integrations.revealpath;

public class RevealFailedException extends Exception {

public RevealFailedException(String msg) {
super(msg);
}

public RevealFailedException(Exception cause) {
super(cause);
}

public RevealFailedException(String msg, Exception cause) {
super(msg, cause);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package org.cryptomator.integrations.revealpath;

import org.cryptomator.integrations.common.IntegrationsLoader;

import java.nio.file.Path;
import java.util.stream.Stream;

public interface RevealPathService {

/**
* Loads all supported service providers.
*
* @return Stream of supported RevealPathService implementations (may be empty)
*/
static Stream<RevealPathService> get() {
return IntegrationsLoader.loadAll(RevealPathService.class).filter(RevealPathService::isSupported);
}

/**
* Reveal the path in the system default file manager.
* <p>
* If the path points to a file, the parent of the file is opened and the file is selected in the file manager window.
* If the path points to a directory, the directory is opened and its content shown in the file manager window.
*
* @param p Path to reveal
* @throws RevealFailedException if revealing the path failed
*/
void reveal(Path p) throws RevealFailedException;

/**
* Indicates, if this provider can be used.
*
* @return true, if this provider is supported in the current OS environment
* @implSpec This check needs to return fast and in constant time
*/
boolean isSupported();

}