Skip to content

Commit cdd1cbc

Browse files
committed
add file system name capability to Winfsp mounter
1 parent d5a0044 commit cdd1cbc

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/main/java/org/cryptomator/frontend/fuse/mount/WinFspMountProvider.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import java.util.Set;
2222
import java.util.concurrent.TimeoutException;
2323

24+
import static org.cryptomator.integrations.mount.MountCapability.FILE_SYSTEM_NAME;
2425
import static org.cryptomator.integrations.mount.MountCapability.MOUNT_AS_DRIVE_LETTER;
2526
import static org.cryptomator.integrations.mount.MountCapability.MOUNT_FLAGS;
2627
import static org.cryptomator.integrations.mount.MountCapability.MOUNT_TO_EXISTING_DIR;
@@ -47,7 +48,7 @@ public boolean isSupported() {
4748

4849
@Override
4950
public Set<MountCapability> capabilities() {
50-
return EnumSet.of(MOUNT_FLAGS, MOUNT_AS_DRIVE_LETTER, MOUNT_WITHIN_EXISTING_PARENT, UNMOUNT_FORCED, READ_ONLY, VOLUME_NAME);
51+
return EnumSet.of(MOUNT_FLAGS, MOUNT_AS_DRIVE_LETTER, MOUNT_WITHIN_EXISTING_PARENT, UNMOUNT_FORCED, READ_ONLY, VOLUME_NAME, FILE_SYSTEM_NAME);
5152
}
5253

5354
@Override
@@ -63,6 +64,8 @@ public MountBuilder forFileSystem(Path vfsRoot) {
6364

6465
protected static class WinFspMountBuilder extends AbstractMountBuilder {
6566

67+
private static String DEFAULT_FS_NAME = "FUSE-NIO-FS";
68+
String fsName = DEFAULT_FS_NAME;
6669
boolean isReadOnly = false;
6770

6871
WinFspMountBuilder(Path vfsRoot) {
@@ -80,6 +83,12 @@ public MountBuilder setMountpoint(Path mountPoint) {
8083
}
8184
}
8285

86+
@Override
87+
public MountBuilder setFileSystemName(String fsName) {
88+
this.fsName = fsName;
89+
return this;
90+
}
91+
8392
@Override
8493
public MountBuilder setReadOnly(boolean mountReadOnly) {
8594
isReadOnly = mountReadOnly;
@@ -98,6 +107,8 @@ protected Set<String> combinedMountFlags() {
98107
combined.removeIf(flag -> flag.startsWith("-oumask="));
99108
combined.add("-oumask=0333");
100109
}
110+
combined.removeIf(flag -> flag.startsWith("-oExactFileSystemName="));
111+
combined.add("-oExactFileSystemName="+fsName);
101112
return combined;
102113
}
103114

0 commit comments

Comments
 (0)