The normal way to unmount a Dokan file system is to call the close() method, or implictly close it in a try/catch block
Also, dokan file system will register a global VM shutdown hook that unmounts the file system if the JVM is killed or interrupted is some unexpected way.
The problem with the global shutdown is that DokanFIleSystem object can be part of a larger composition of objects where the order of shutting down resources can be very important and is determined by the owner object, for example:
My recommendation is to not register a global shutdown hook - this can always be done outside in the owning object. My current workaround for now is to override the mount() method and remove the shutdown registration...
The normal way to unmount a Dokan file system is to call the close() method, or implictly close it in a try/catch block Also, dokan file system will register a global VM shutdown hook that unmounts the file system if the JVM is killed or interrupted is some unexpected way.
The problem with the global shutdown is that DokanFIleSystem object can be part of a larger composition of objects where the order of shutting down resources can be very important and is determined by the owner object, for example:
My recommendation is to not register a global shutdown hook - this can always be done outside in the owning object. My current workaround for now is to override the mount() method and remove the shutdown registration...