Skip to content

Commit 4141ec8

Browse files
committed
Rename MountFeature.PORT to LOOPBACK_PORT and adjust related methods
1 parent 72ae4b3 commit 4141ec8

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

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

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,18 @@
1313
*/
1414
public interface MountBuilder {
1515

16+
/**
17+
* Use the given TCP port of the loopback address.
18+
*
19+
* @param port Fixed TCP port or 0 to use a system-assigned port
20+
* @return <code>this</code>
21+
* @throws UnsupportedOperationException If {@link MountFeature#LOOPBACK_PORT} is not supported
22+
*/
23+
@Contract("_ -> this")
24+
default MountBuilder setLoopbackPort(@Range(from = 0, to = Short.MAX_VALUE) int port) {
25+
throw new UnsupportedOperationException();
26+
}
27+
1628
/**
1729
* Sets the mount point.
1830
* <p>
@@ -39,17 +51,6 @@ default MountBuilder setMountFlags(String mountFlags) {
3951
throw new UnsupportedOperationException();
4052
}
4153

42-
/**
43-
* Use the given TCP port.
44-
*
45-
* @param port Fixed TCP port or 0 to use a system-assigned port
46-
* @return <code>this</code>
47-
* @throws UnsupportedOperationException If {@link MountFeature#PORT} is not supported
48-
*/
49-
@Contract("_ -> this")
50-
default MountBuilder setPort(@Range(from = 0, to = Short.MAX_VALUE) int port) {
51-
throw new UnsupportedOperationException();
52-
}
5354

5455
/**
5556
* Instructs the mount to be read-only.

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
* This may be used to show or hide different configuration options depending on the chosen mount provider.
99
*/
1010
public enum MountFeature {
11+
/**
12+
* The provider supports {@link MountProvider#getDefaultLoopbackPort()}
13+
* and the builder requires {@link MountBuilder#setLoopbackPort(int)}.
14+
*/
15+
LOOPBACK_PORT,
16+
1117
/**
1218
* The provider supports {@link MountProvider#getDefaultMountFlags(String)}
1319
* and the builder requires {@link MountBuilder#setMountFlags(String)}.
@@ -47,12 +53,6 @@ public enum MountFeature {
4753
*/
4854
MOUNT_TO_SYSTEM_CHOSEN_PATH,
4955

50-
/**
51-
* The provider supports {@link MountProvider#getDefaultPort()}
52-
* and the builder requires {@link MountBuilder#setPort(int)}.
53-
*/
54-
PORT,
55-
5656
/**
5757
* The builder supports {@link MountBuilder#setReadOnly(boolean)}.
5858
*/

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import org.cryptomator.integrations.common.IntegrationsLoader;
44
import org.jetbrains.annotations.Contract;
5-
import org.jetbrains.annotations.NotNull;
65
import org.jetbrains.annotations.Range;
76

87
import java.nio.file.Path;
@@ -52,13 +51,13 @@ default String getDefaultMountFlags(String mountName) {
5251
}
5352

5453
/**
55-
* The default TCP port used by this provider.
54+
* The default TCP port of the loopback address used by this provider.
5655
*
5756
* @return fixed TCP port or 0 to use a system-assigned port
58-
* @throws UnsupportedOperationException If {@link MountFeature#PORT} is not supported
57+
* @throws UnsupportedOperationException If {@link MountFeature#LOOPBACK_PORT} is not supported
5958
*/
6059
@Range(from = 0, to = Short.MAX_VALUE)
61-
default int getDefaultPort() {
60+
default int getDefaultLoopbackPort() {
6261
throw new UnsupportedOperationException();
6362
}
6463

0 commit comments

Comments
 (0)