Class DokanyMount
java.lang.Object
org.cryptomator.frontend.dokany.internal.DokanyMount
- All Implemented Interfaces:
AutoCloseable
Main class to start and stop Dokany file system.
-
Constructor Summary
ConstructorsConstructorDescriptionDokanyMount(DeviceOptions deviceOptions, DokanyFileSystem fileSystem) DokanyMount(DeviceOptions deviceOptions, DokanyFileSystem fileSystem, SafeUnmountCheck unmountCheck) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Unmounts the Dokan device from its mount point.static longGet driver version.static longGet Dokany version.voidmount()CallsNativeMethods.DokanMain(DeviceOptions, DokanyOperations)in a new thread.voidCallsNativeMethods.DokanMain(DeviceOptions, DokanyOperations)in a new thread and after DokanMain exit runs the specified action with an throwable as parameter if DokanMain terminiated irregularly.voidunmount()Unmounts the filessystem, if it is safe.voidUnmounts the filesystem, no matter what.
-
Constructor Details
-
DokanyMount
-
DokanyMount
public DokanyMount(DeviceOptions deviceOptions, DokanyFileSystem fileSystem, SafeUnmountCheck unmountCheck)
-
-
Method Details
-
getDriverVersion
public static long getDriverVersion()Get driver version.- Returns:
-
getVersion
public static long getVersion()Get Dokany version.- Returns:
-
mount
CallsNativeMethods.DokanMain(DeviceOptions, DokanyOperations)in a new thread. No-op if this object is already mounted.Additionally a shutdown hook invoking
close()is registered to the JVM.- Throws:
DokanyException
-
mount
CallsNativeMethods.DokanMain(DeviceOptions, DokanyOperations)in a new thread and after DokanMain exit runs the specified action with an throwable as parameter if DokanMain terminiated irregularly. No-op if this object is already mounted.Additionally a shutdown hook invoking
close()is registered to the JVM.- Parameters:
onDokanExit- object with a run() method which is executed after the Dokan process exited- Throws:
DokanyException
-
close
public void close()Unmounts the Dokan device from its mount point. No-op if the device is not mounted.- Specified by:
closein interfaceAutoCloseable
-
unmount
Unmounts the filessystem, if it is safe.- Throws:
IllegalStateException- if it is currently not possible to unmount the filesytsem.
-
unmountForced
public void unmountForced()Unmounts the filesystem, no matter what.
-