File tree Expand file tree Collapse file tree
src/main/java/org/cryptomator/integrations/filemanagersidebar Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package org .cryptomator .integrations .filemanagersidebar ;
22
33import org .cryptomator .integrations .common .IntegrationsLoader ;
4+ import org .jetbrains .annotations .NotNull ;
45
6+ import java .io .Closeable ;
57import java .nio .file .Path ;
68import java .util .Optional ;
79
10+ /**
11+ * Service for integrating a given path into the sidebar/quick access bar of a filemanager.
12+ */
813public interface SidebarService {
914
10- SidebarEntry add (Path mountpoint );
15+ /**
16+ * Creates an entry in the filemanager sidebar.
17+ *
18+ * @param displayName The display name of the sidebar entry
19+ * @param target The filesystem path the sidebar entry points to.
20+ * @return a @{link SidebarEntry } object
21+ */
22+ SidebarEntry add (@ NotNull String displayName , @ NotNull Path target ) throws SidebarServiceException ;
1123
12- interface SidebarEntry {
13- void remove ();
24+ /**
25+ * An entry of the filemanager sidebar, created with this service.
26+ */
27+ interface SidebarEntry extends Closeable {
28+
29+ /**
30+ * Removes this entry from the sidebar. Once removed, this object cannot be added again.
31+ */
32+ void remove () throws SidebarServiceException ;
33+
34+ default void close () {
35+ remove ();
36+ }
1437 }
1538
1639 static Optional <SidebarService > get () {
Original file line number Diff line number Diff line change 1+ package org .cryptomator .integrations .filemanagersidebar ;
2+
3+ public class SidebarServiceException extends RuntimeException {
4+ }
You can’t perform that action at this time.
0 commit comments