Skip to content

Commit 3a17610

Browse files
committed
More lean API. Removed features might be readded later:
* removed OnExitAction feature * removed reveal() funtion * renamed getAccessPoint()
1 parent 9b76bf8 commit 3a17610

File tree

4 files changed

+6
-37
lines changed

4 files changed

+6
-37
lines changed

src/main/java/org/cryptomator/integrations/mount/Mount.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package org.cryptomator.integrations.mount;
22

33
import java.nio.file.Path;
4-
import java.util.function.Consumer;
54

65
/**
76
* Handle to control the lifecycle of a mounted file system.
@@ -10,12 +9,12 @@
109
*/
1110
public interface Mount extends AutoCloseable {
1211

13-
//TODO: either this or reveal method, not both
14-
Path getAccessPoint();
15-
16-
//TODO: is this needed? why not just let the consumer reveal?
17-
// See WebDAV: LinuxGioMounter and LinuxGvfsMounter -> no path, just a command
18-
void reveal(Consumer<Path> cmd);
12+
/**
13+
* Returns the absolute OS path, where this mount can be accessed.
14+
*
15+
* @return Absolute path to the mountpoint.
16+
*/
17+
Path getMountpoint();
1918

2019
/**
2120
* Unmounts the mounted Volume.

src/main/java/org/cryptomator/integrations/mount/MountBuilder.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import org.jetbrains.annotations.Range;
55

66
import java.nio.file.Path;
7-
import java.util.function.Consumer;
87

98
/**
109
* Builder to mount a filesystem.
@@ -14,8 +13,6 @@
1413
*/
1514
public interface MountBuilder {
1615

17-
//TODO: Idea: every setter verifies the set and can throw an IllegalArgumentException
18-
1916
/**
2017
* Sets the mount point.
2118
*
@@ -26,12 +23,6 @@ public interface MountBuilder {
2623
@Contract("_ -> this")
2724
MountBuilder setMountpoint(Path mountPoint);
2825

29-
// TODO: in what legacy mounter impl is this used?
30-
@Contract("_ -> this")
31-
default MountBuilder setOnExitAction(Consumer<Throwable> onExitAction) {
32-
throw new UnsupportedOperationException();
33-
}
34-
3526
/**
3627
* Sets mount flags.
3728
*

src/main/java/org/cryptomator/integrations/mount/MountFeature.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,6 @@ public enum MountFeature {
5656
*/
5757
UNMOUNT_FORCED,
5858

59-
/**
60-
* The mount supports triggering an event handler, which is somehow triggered at a specific time. // TODO what?
61-
*/
62-
ON_EXIT_ACTION,
63-
6459
/**
6560
* The provider supports {@link MountProvider#getDefaultPort()}
6661
* and the builder requires {@link MountBuilder#setPort(int)}.

src/main/java/org/cryptomator/integrations/mount/MountProvider.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,6 @@
99
import java.util.Set;
1010
import java.util.stream.Stream;
1111

12-
// Vorteile:
13-
// * IoC: Ein Provider weiß was er kann und was nicht!
14-
// * Wegfall der komplizierten Mountpoint Logik
15-
// * App beschränkt sich mehr auf GUI und Logik darum
16-
// * Einfaches ändern/entfernen eines Providers
17-
// * Mounten ist eine Systemintegration!
18-
// * Tests!?
19-
// * Illegal Mount Options Check?
20-
// * In der GUI sieht der Nutzer sofort, was sich ändert.
21-
// Nachteile:
22-
// * Code-Duplikation
23-
// * WebDAV-ServerPort? (-> Legacy Option in Preferences?)
24-
// Ungeklärt:
25-
// * Anzeigen von Fehler dem User (-> Translations nutzbar?)
26-
// * Langfristiger Wechsel zu eigenständigen Prozessen?
27-
2812
/**
2913
* A mechanism to mount a file system.
3014
*

0 commit comments

Comments
 (0)