mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-17 10:11:27 +00:00
Renamed IrregularUnmountCleaner to MountPointHelper
This commit is contained in:
@@ -15,15 +15,15 @@ import java.nio.file.attribute.BasicFileAttributes;
|
||||
import java.util.Optional;
|
||||
|
||||
@Singleton
|
||||
class IrregularUnmountCleaner {
|
||||
class MountPointHelper {
|
||||
|
||||
public static Logger LOG = LoggerFactory.getLogger(IrregularUnmountCleaner.class);
|
||||
public static Logger LOG = LoggerFactory.getLogger(MountPointHelper.class);
|
||||
|
||||
private final Optional<Path> tmpMountPointDir;
|
||||
private volatile boolean alreadyChecked = false;
|
||||
|
||||
@Inject
|
||||
public IrregularUnmountCleaner(Environment env) {
|
||||
public MountPointHelper(Environment env) {
|
||||
this.tmpMountPointDir = env.getMountPointsDir();
|
||||
}
|
||||
|
||||
@@ -20,14 +20,13 @@ class TemporaryMountPointChooser implements MountPointChooser {
|
||||
|
||||
private final VaultSettings vaultSettings;
|
||||
private final Environment environment;
|
||||
private final IrregularUnmountCleaner cleaner;
|
||||
private volatile boolean clearedDebris;
|
||||
private final MountPointHelper helper;
|
||||
|
||||
@Inject
|
||||
public TemporaryMountPointChooser(VaultSettings vaultSettings, Environment environment, IrregularUnmountCleaner cleaner) {
|
||||
public TemporaryMountPointChooser(VaultSettings vaultSettings, Environment environment, MountPointHelper helper) {
|
||||
this.vaultSettings = vaultSettings;
|
||||
this.environment = environment;
|
||||
this.cleaner = cleaner;
|
||||
this.helper = helper;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -44,7 +43,7 @@ class TemporaryMountPointChooser implements MountPointChooser {
|
||||
assert environment.getMountPointsDir().isPresent();
|
||||
//clean leftovers of not-regularly unmounted vaults
|
||||
//see https://github.com/cryptomator/cryptomator/issues/1013 and https://github.com/cryptomator/cryptomator/issues/1061
|
||||
cleaner.clearIrregularUnmountDebrisIfNeeded();
|
||||
helper.clearIrregularUnmountDebrisIfNeeded();
|
||||
return this.environment.getMountPointsDir().map(this::choose);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user