Browse Source

Renamed IrregularUnmountCleaner to MountPointHelper

JaniruTEC 4 years ago
parent
commit
21387bd76c

+ 3 - 3
main/commons/src/main/java/org/cryptomator/common/mountpoint/IrregularUnmountCleaner.java

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

+ 4 - 5
main/commons/src/main/java/org/cryptomator/common/mountpoint/TemporaryMountPointChooser.java

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