Merge branch 'develop' into feature/hub-local-access

This commit is contained in:
Armin Schrenk
2023-03-20 20:43:34 +01:00
57 changed files with 1087 additions and 693 deletions

View File

@@ -2,6 +2,10 @@ package org.cryptomator.common.mount;
public class MountPointPreparationException extends RuntimeException {
public MountPointPreparationException(String msg) {
super(msg);
}
public MountPointPreparationException(Throwable cause) {
super(cause);
}

View File

@@ -51,8 +51,19 @@ public final class MountWithinParentUtil {
if (SystemUtils.IS_OS_WINDOWS) {
Files.setAttribute(hideaway, WIN_HIDDEN_ATTR, true, LinkOption.NOFOLLOW_LINKS);
}
int attempts = 0;
while (!Files.notExists(mountPoint)) {
if (attempts >= 10) {
throw new MountPointPreparationException("Path " + mountPoint + " could not be cleared");
}
Thread.sleep(1000);
attempts++;
}
} catch (IOException e) {
throw new MountPointPreparationException(e);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new MountPointPreparationException(e);
}
}
}

View File

@@ -6,6 +6,7 @@ import org.slf4j.LoggerFactory;
import javax.inject.Inject;
import javax.inject.Singleton;
import javafx.application.Platform;
import javafx.collections.ObservableList;
import java.io.IOException;
import java.time.Instant;
@@ -40,6 +41,7 @@ public class AutoLocker {
private void autolock(Vault vault) {
try {
vault.lock(false);
Platform.runLater(() -> vault.stateProperty().set(VaultState.Value.LOCKED));
LOG.info("Autolocked {} after idle timeout", vault.getDisplayName());
} catch (UnmountFailedException | IOException e) {
LOG.error("Autolocking failed.", e);

View File

@@ -23,7 +23,7 @@ import java.util.ResourceBundle;
@PreferencesScoped
public class VolumePreferencesController implements FxController {
private static final String DOCS_MOUNTING_URL = "https://docs.cryptomator.org/en/1.7/desktop/vault-mounting/";
private static final String DOCS_MOUNTING_URL = "https://docs.cryptomator.org/en/1.7/desktop/volume-type/";
private final Settings settings;
private final ObservableValue<MountService> selectedMountService;