|
13 | 13 | */ |
14 | 14 | public interface MountBuilder { |
15 | 15 |
|
| 16 | + /** |
| 17 | + * Sets the file system name. |
| 18 | + * |
| 19 | + * @param fileSystemName file system name |
| 20 | + * @return <code>this</code> |
| 21 | + * @throws UnsupportedOperationException If {@link MountCapability#FILE_SYSTEM_NAME} is not supported |
| 22 | + */ |
| 23 | + @Contract("_ -> this") |
| 24 | + default MountBuilder setFileSystemName(String fileSystemName) { |
| 25 | + throw new UnsupportedOperationException(); |
| 26 | + } |
| 27 | + |
| 28 | + /** |
| 29 | + * Use the given host name as the loopback address. |
| 30 | + * |
| 31 | + * @param hostName string conforming with the uri host part |
| 32 | + * @return <code>this</code> |
| 33 | + * @throws UnsupportedOperationException If {@link MountCapability#LOOPBACK_HOST_NAME} is not supported |
| 34 | + */ |
| 35 | + @Contract("_ -> this") |
| 36 | + default MountBuilder setLoopbackHostName(String hostName) { |
| 37 | + throw new UnsupportedOperationException(); |
| 38 | + } |
| 39 | + |
| 40 | + /** |
| 41 | + * Use the given TCP port of the loopback address. |
| 42 | + * |
| 43 | + * @param port Fixed TCP port or 0 to use a system-assigned port |
| 44 | + * @return <code>this</code> |
| 45 | + * @throws UnsupportedOperationException If {@link MountCapability#LOOPBACK_PORT} is not supported |
| 46 | + */ |
| 47 | + @Contract("_ -> this") |
| 48 | + default MountBuilder setLoopbackPort(@Range(from = 0, to = Short.MAX_VALUE) int port) { |
| 49 | + throw new UnsupportedOperationException(); |
| 50 | + } |
| 51 | + |
16 | 52 | /** |
17 | 53 | * Sets the mount point. |
| 54 | + * <p> |
| 55 | + * Unless the mount service provider supports {@link MountCapability#MOUNT_TO_SYSTEM_CHOSEN_PATH}, setting a mount point is required. |
18 | 56 | * |
19 | 57 | * @param mountPoint Where to mount the volume |
20 | 58 | * @return <code>this</code> |
21 | | - * @see MountProvider#getDefaultMountPoint(String) |
22 | 59 | */ |
23 | 60 | @Contract("_ -> this") |
24 | | - MountBuilder setMountpoint(Path mountPoint); |
| 61 | + default MountBuilder setMountpoint(Path mountPoint) { |
| 62 | + throw new UnsupportedOperationException(); |
| 63 | + } |
25 | 64 |
|
26 | 65 | /** |
27 | 66 | * Sets mount flags. |
28 | 67 | * |
29 | 68 | * @param mountFlags Mount flags |
30 | 69 | * @return <code>this</code> |
31 | | - * @throws UnsupportedOperationException If {@link MountFeature#MOUNT_FLAGS} is not supported |
32 | | - * @see MountProvider#getDefaultMountFlags(String) |
| 70 | + * @throws UnsupportedOperationException If {@link MountCapability#MOUNT_FLAGS} is not supported |
| 71 | + * @see MountService#getDefaultMountFlags() |
33 | 72 | */ |
34 | 73 | @Contract("_ -> this") |
35 | 74 | default MountBuilder setMountFlags(String mountFlags) { |
36 | 75 | throw new UnsupportedOperationException(); |
37 | 76 | } |
38 | 77 |
|
| 78 | + |
39 | 79 | /** |
40 | 80 | * Instructs the mount to be read-only. |
41 | 81 | * |
42 | 82 | * @param mountReadOnly Whether to mount read-only. |
43 | 83 | * @return <code>this</code> |
44 | | - * @throws UnsupportedOperationException If {@link MountFeature#READ_ONLY} is not supported |
| 84 | + * @throws UnsupportedOperationException If {@link MountCapability#READ_ONLY} is not supported |
45 | 85 | */ |
46 | 86 | @Contract("_ -> this") |
47 | 87 | default MountBuilder setReadOnly(boolean mountReadOnly) { |
48 | 88 | throw new UnsupportedOperationException(); |
49 | 89 | } |
50 | 90 |
|
51 | 91 | /** |
52 | | - * Use the given TCP port. |
| 92 | + * Sets a unique volume id. |
| 93 | + * <p> |
| 94 | + * The volume id is used as a path component, thus must conform with the os-dependent path component restrictions. |
53 | 95 | * |
54 | | - * @param port fixed TCP port or 0 to use a system-assigned port |
| 96 | + * @param volumeId String conforming with the os-dependent path component restrictions |
55 | 97 | * @return <code>this</code> |
56 | | - * @throws UnsupportedOperationException If {@link MountFeature#PORT} is not supported |
| 98 | + * @throws UnsupportedOperationException If {@link MountCapability#VOLUME_ID} is not supported |
57 | 99 | */ |
58 | 100 | @Contract("_ -> this") |
59 | | - default MountBuilder setPort(@Range(from = 0, to = Short.MAX_VALUE) int port) { |
| 101 | + default MountBuilder setVolumeId(String volumeId) { |
60 | 102 | throw new UnsupportedOperationException(); |
61 | 103 | } |
62 | 104 |
|
| 105 | + /** |
| 106 | + * Sets a volume name. |
| 107 | + * <p> |
| 108 | + * The volume name is intended to be human-readable. The input string might be altered to replace non-conforming characters and thus is not suited to identify the volume. |
| 109 | + * |
| 110 | + * @param volumeName String conforming with the os-dependent naming restrictions |
| 111 | + * @return <code>this</code> |
| 112 | + * @throws UnsupportedOperationException If {@link MountCapability#VOLUME_NAME} is not supported |
| 113 | + */ |
| 114 | + @Contract("_ -> this") |
| 115 | + default MountBuilder setVolumeName(String volumeName) { |
| 116 | + throw new UnsupportedOperationException(); |
| 117 | + } |
63 | 118 |
|
64 | 119 | /** |
65 | 120 | * Mounts the file system. |
|
0 commit comments