Skip to content

Commit fdc2ba7

Browse files
committed
Add capability VOLUME_NAME
1 parent 945177b commit fdc2ba7

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ default MountBuilder setReadOnly(boolean mountReadOnly) {
7878

7979
/**
8080
* Sets a unique volume id.
81+
* <p>
82+
* The volume id is used as a path component, thus must conform with the os-dependent path component restrictions.
8183
*
8284
* @param volumeId String conforming with the os-dependent path component restrictions
8385
* @return <code>this</code>
@@ -88,6 +90,20 @@ default MountBuilder setVolumeId(String volumeId) {
8890
throw new UnsupportedOperationException();
8991
}
9092

93+
/**
94+
* Sets a volume name.
95+
* <p>
96+
* 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.
97+
*
98+
* @param volumeName String conforming with the os-dependent naming restrictions
99+
* @return <code>this</code>
100+
* @throws UnsupportedOperationException If {@link MountCapability#VOLUME_ID} is not supported
101+
*/
102+
@Contract("_ -> this")
103+
default MountBuilder setVolumeName(String volumeName) {
104+
throw new UnsupportedOperationException();
105+
}
106+
91107
/**
92108
* Mounts the file system.
93109
*

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,10 @@ public enum MountCapability {
7171
/**
7272
* The builder requires {@link MountBuilder#setVolumeId(String)}.
7373
*/
74-
VOLUME_ID
74+
VOLUME_ID,
75+
76+
/**
77+
* The builder supports {@link MountBuilder#setVolumeName(String)}.
78+
*/
79+
VOLUME_NAME
7580
}

0 commit comments

Comments
 (0)