mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-22 04:31:27 +00:00
fixes #1208
This commit is contained in:
@@ -29,6 +29,7 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.FileAlreadyExistsException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.NoSuchFileException;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.ResourceBundle;
|
||||
@@ -123,6 +124,9 @@ public class CreateNewVaultLocationController implements FxController {
|
||||
} catch (FileAlreadyExistsException e) {
|
||||
LOG.warn("Can not use already existing vault path {}", vaultPath.get());
|
||||
warningText.set(resourceBundle.getString("addvaultwizard.new.fileAlreadyExists"));
|
||||
} catch (NoSuchFileException e) {
|
||||
LOG.warn("At least one path component does not exist of path {}", vaultPath.get());
|
||||
warningText.set(resourceBundle.getString("addvaultwizard.new.locationDoesNotExist"));
|
||||
} catch (IOException e) {
|
||||
LOG.error("Failed to create and delete directory at chosen vault path.", e);
|
||||
errorComponent.cause(e).window(window).returnToScene(window.getScene()).build().showErrorScene();
|
||||
@@ -133,7 +137,11 @@ public class CreateNewVaultLocationController implements FxController {
|
||||
public void chooseCustomVaultPath() {
|
||||
DirectoryChooser directoryChooser = new DirectoryChooser();
|
||||
directoryChooser.setTitle(resourceBundle.getString("addvaultwizard.new.directoryPickerTitle"));
|
||||
directoryChooser.setInitialDirectory(customVaultPath.toFile());
|
||||
if (Files.exists(customVaultPath)) {
|
||||
directoryChooser.setInitialDirectory(customVaultPath.toFile());
|
||||
} else {
|
||||
directoryChooser.setInitialDirectory(DEFAULT_CUSTOM_VAULT_PATH.toFile());
|
||||
}
|
||||
final File file = directoryChooser.showDialog(window);
|
||||
if (file != null) {
|
||||
customVaultPath = file.toPath().toAbsolutePath();
|
||||
|
||||
@@ -43,6 +43,7 @@ addvaultwizard.new.directoryPickerLabel=Custom Location
|
||||
addvaultwizard.new.directoryPickerButton=Choose…
|
||||
addvaultwizard.new.directoryPickerTitle=Select Directory
|
||||
addvaultwizard.new.fileAlreadyExists=Vault can not be created at this path because some object already exists.
|
||||
addvaultwizard.new.locationDoesNotExist=Vault can not be created at this path because at least one path component does not exist.
|
||||
addvaultwizard.new.invalidName=Invalid vault name. Please consider a regular directory name.
|
||||
### Password
|
||||
addvaultwizard.new.createVaultBtn=Create Vault
|
||||
|
||||
Reference in New Issue
Block a user