File tree Expand file tree Collapse file tree 3 files changed +58
-0
lines changed
org/cryptomator/integrations/revealpath Expand file tree Collapse file tree 3 files changed +58
-0
lines changed Original file line number Diff line number Diff line change 11import org .cryptomator .integrations .mount .MountService ;
2+ import org .cryptomator .integrations .revealpath .RevealPathService ;
23import org .cryptomator .integrations .tray .TrayMenuController ;
34import org .cryptomator .integrations .autostart .AutoStartProvider ;
45import org .cryptomator .integrations .keychain .KeychainAccessProvider ;
1415 exports org .cryptomator .integrations .common ;
1516 exports org .cryptomator .integrations .keychain ;
1617 exports org .cryptomator .integrations .mount ;
18+ exports org .cryptomator .integrations .revealpath ;
1719 exports org .cryptomator .integrations .tray ;
1820 exports org .cryptomator .integrations .uiappearance ;
1921
2022 uses AutoStartProvider ;
2123 uses KeychainAccessProvider ;
2224 uses MountService ;
25+ uses RevealPathService ;
2326 uses TrayIntegrationProvider ;
2427 uses TrayMenuController ;
2528 uses UiAppearanceProvider ;
Original file line number Diff line number Diff line change 1+ package org .cryptomator .integrations .revealpath ;
2+
3+ public class RevealFailedException extends Exception {
4+
5+ public RevealFailedException (String msg ) {
6+ super (msg );
7+ }
8+
9+ public RevealFailedException (Exception cause ) {
10+ super (cause );
11+ }
12+
13+ public RevealFailedException (String msg , Exception cause ) {
14+ super (msg , cause );
15+ }
16+
17+ }
Original file line number Diff line number Diff line change 1+ package org .cryptomator .integrations .revealpath ;
2+
3+ import org .cryptomator .integrations .common .IntegrationsLoader ;
4+
5+ import java .nio .file .Path ;
6+ import java .util .stream .Stream ;
7+
8+ public interface RevealPathService {
9+
10+ /**
11+ * Loads all supported service providers.
12+ *
13+ * @return Stream of supported RevealPathService implementations (may be empty)
14+ */
15+ static Stream <RevealPathService > get () {
16+ return IntegrationsLoader .loadAll (RevealPathService .class ).filter (RevealPathService ::isSupported );
17+ }
18+
19+ /**
20+ * Reveal the path in the system default file manager.
21+ * <p>
22+ * If the path points to a file, the parent of the file is opened and the file is selected in the file manager window.
23+ * If the path points to a directory, the directory is opened and its content shown in the file manager window.
24+ *
25+ * @param p Path to reveal
26+ * @throws RevealFailedException if revealing the path failed
27+ */
28+ void reveal (Path p ) throws RevealFailedException ;
29+
30+ /**
31+ * Indicates, if this provider can be used.
32+ *
33+ * @return true, if this provider is supported in the current OS environment
34+ * @implSpec This check needs to return fast and in constant time
35+ */
36+ boolean isSupported ();
37+
38+ }
You can’t perform that action at this time.
0 commit comments