Renamed IrregularUnmountCleaner to MountPointHelper

This commit is contained in:
JaniruTEC
2020-11-18 16:18:31 +01:00
parent 52cd560cb2
commit 21387bd76c
2 changed files with 7 additions and 8 deletions

View File

@@ -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();
}

View File

@@ -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);
}