activate ability to abort vault locking if it is mounted with dokany and still busy

references #1228
This commit is contained in:
Armin Schrenk
2020-11-19 17:20:08 +01:00
parent 02fc9b263a
commit 5d00b3dd76

View File

@@ -13,7 +13,6 @@ import org.slf4j.LoggerFactory;
import javax.inject.Inject;
import javax.inject.Named;
import java.util.SortedSet;
import java.util.concurrent.ExecutorService;
public class DokanyVolume extends AbstractVolume {
@@ -42,7 +41,6 @@ public class DokanyVolume extends AbstractVolume {
@Override
public void mount(CryptoFileSystem fs, String mountFlags) throws InvalidMountPointException, VolumeException {
this.mountPoint = determineMountPoint();
String mountName = vaultSettings.mountName().get();
try {
this.mount = mountFactory.mount(fs.getPath("/"), mountPoint, vaultSettings.mountName().get(), FS_TYPE_NAME, mountFlags.strip());
} catch (MountFailedException e) {
@@ -62,8 +60,18 @@ public class DokanyVolume extends AbstractVolume {
}
@Override
public void unmount() {
mount.close();
public void unmount() throws VolumeException {
try {
mount.unmount();
} catch (IllegalStateException e) {
throw new VolumeException("Unmount Failed.", e);
}
cleanupMountPoint();
}
@Override
public void unmountForced() {
mount.close(); //TODO: with next dokany-nio-release, change this to unmountForced()
cleanupMountPoint();
}