diff --git a/main/commons/src/main/java/org/cryptomator/common/vaults/DokanyVolume.java b/main/commons/src/main/java/org/cryptomator/common/vaults/DokanyVolume.java index 117f888c9..69193277d 100644 --- a/main/commons/src/main/java/org/cryptomator/common/vaults/DokanyVolume.java +++ b/main/commons/src/main/java/org/cryptomator/common/vaults/DokanyVolume.java @@ -2,6 +2,7 @@ package org.cryptomator.common.vaults; import com.google.common.base.Strings; import org.cryptomator.common.settings.VaultSettings; +import org.cryptomator.common.settings.VolumeImpl; import org.cryptomator.cryptofs.CryptoFileSystem; import org.cryptomator.frontend.dokany.Mount; import org.cryptomator.frontend.dokany.MountFactory; @@ -44,6 +45,11 @@ public class DokanyVolume implements Volume { return DokanyVolume.isSupportedStatic(); } + @Override + public VolumeImpl getImplementationType() { + return VolumeImpl.DOKANY; + } + @Override public void mount(CryptoFileSystem fs, String mountFlags) throws VolumeException, IOException { this.mountPoint = determineMountPoint(); diff --git a/main/commons/src/main/java/org/cryptomator/common/vaults/FuseVolume.java b/main/commons/src/main/java/org/cryptomator/common/vaults/FuseVolume.java index 4b6918be9..e3575f855 100644 --- a/main/commons/src/main/java/org/cryptomator/common/vaults/FuseVolume.java +++ b/main/commons/src/main/java/org/cryptomator/common/vaults/FuseVolume.java @@ -4,6 +4,7 @@ import com.google.common.base.Splitter; import org.apache.commons.lang3.SystemUtils; import org.cryptomator.common.Environment; import org.cryptomator.common.settings.VaultSettings; +import org.cryptomator.common.settings.VolumeImpl; import org.cryptomator.cryptofs.CryptoFileSystem; import org.cryptomator.frontend.fuse.mount.CommandFailedException; import org.cryptomator.frontend.fuse.mount.EnvironmentVariables; @@ -165,6 +166,11 @@ public class FuseVolume implements Volume { return FuseVolume.isSupportedStatic(); } + @Override + public VolumeImpl getImplementationType() { + return VolumeImpl.FUSE; + } + @Override public Optional getMountPoint() { return Optional.ofNullable(mountPoint); diff --git a/main/commons/src/main/java/org/cryptomator/common/vaults/Volume.java b/main/commons/src/main/java/org/cryptomator/common/vaults/Volume.java index a0aa11be8..3f350c8a1 100644 --- a/main/commons/src/main/java/org/cryptomator/common/vaults/Volume.java +++ b/main/commons/src/main/java/org/cryptomator/common/vaults/Volume.java @@ -20,6 +20,12 @@ public interface Volume { */ boolean isSupported(); + /** + * Gets the coresponding enum type of the {@link VolumeImpl volume implementation ("VolumeImpl")} that is implemented by this Volume. + * @return the type of implementation as defined by the {@link VolumeImpl VolumeImpl enum} + */ + VolumeImpl getImplementationType(); + /** * @param fs * @throws IOException diff --git a/main/commons/src/main/java/org/cryptomator/common/vaults/WebDavVolume.java b/main/commons/src/main/java/org/cryptomator/common/vaults/WebDavVolume.java index 9c59790fa..12e78b825 100644 --- a/main/commons/src/main/java/org/cryptomator/common/vaults/WebDavVolume.java +++ b/main/commons/src/main/java/org/cryptomator/common/vaults/WebDavVolume.java @@ -3,6 +3,7 @@ package org.cryptomator.common.vaults; import org.cryptomator.common.settings.Settings; import org.cryptomator.common.settings.VaultSettings; +import org.cryptomator.common.settings.VolumeImpl; import org.cryptomator.cryptofs.CryptoFileSystem; import org.cryptomator.frontend.webdav.WebDavServer; import org.cryptomator.frontend.webdav.mount.MountParams; @@ -126,6 +127,11 @@ public class WebDavVolume implements Volume { return WebDavVolume.isSupportedStatic(); } + @Override + public VolumeImpl getImplementationType() { + return VolumeImpl.WEBDAV; + } + @Override public boolean supportsForcedUnmount() { return mount != null && mount.forced().isPresent();