Skip to content

Commit c96eceb

Browse files
committed
changing API
* sidebar entries do not have be closable * make sidebarService exception checked
1 parent 957fdcb commit c96eceb

2 files changed

Lines changed: 15 additions & 9 deletions

File tree

src/main/java/org/cryptomator/integrations/filemanagersidebar/SidebarService.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,21 @@ public interface SidebarService {
1717
*
1818
* @param displayName The display name of the sidebar entry
1919
* @param target The filesystem path the sidebar entry points to.
20-
* @return a @{link SidebarEntry } object
20+
* @return a @{link SidebarEntry } object, used to remove the entry again
21+
* @apiNote Depending on the implemenation, the display name may not be used.
2122
*/
22-
SidebarEntry add(@NotNull String displayName, @NotNull Path target) throws SidebarServiceException;
23+
SidebarEntry add(@NotNull Path target, @NotNull String displayName) throws SidebarServiceException;
2324

2425
/**
25-
* An entry of the filemanager sidebar, created with this service.
26+
* An entry of the filemanager sidebar, created by an implementation of this service.
2627
*/
27-
interface SidebarEntry extends Closeable {
28+
interface SidebarEntry {
2829

2930
/**
3031
* Removes this entry from the sidebar. Once removed, this object cannot be added again.
3132
*/
32-
void remove() throws SidebarServiceException;
33+
void remove();
3334

34-
default void close() {
35-
remove();
36-
}
3735
}
3836

3937
static Optional<SidebarService> get() {
Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
package org.cryptomator.integrations.filemanagersidebar;
22

3-
public class SidebarServiceException extends RuntimeException {
3+
public class SidebarServiceException extends Exception {
4+
5+
public SidebarServiceException(String message) {
6+
super(message);
7+
}
8+
9+
public SidebarServiceException(String message, Throwable t) {
10+
super(message, t);
11+
}
412
}

0 commit comments

Comments
 (0)