mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-17 18:21:26 +00:00
Merge branch 'develop' of https://github.com/cryptomator/cryptomator into develop
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -18,3 +18,6 @@ out/
|
||||
.idea_modules/
|
||||
*.iws
|
||||
*.iml
|
||||
|
||||
# Temporary file created by test launcher
|
||||
main/launcher/ipcPort.tmp
|
||||
|
||||
@@ -34,6 +34,10 @@
|
||||
<groupId>com.google.dagger</groupId>
|
||||
<artifactId>dagger</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.dagger</groupId>
|
||||
<artifactId>dagger-compiler</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.google.dagger</groupId>
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
package org.cryptomator.ui.controllers;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.DirectoryNotEmptyException;
|
||||
import java.nio.file.FileAlreadyExistsException;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
@@ -125,8 +124,6 @@ public class InitializeController implements ViewController {
|
||||
listener.ifPresent(this::invokeListenerLater);
|
||||
} catch (FileAlreadyExistsException ex) {
|
||||
messageLabel.setText(localization.getString("initialize.messageLabel.alreadyInitialized"));
|
||||
} catch (DirectoryNotEmptyException ex) {
|
||||
messageLabel.setText(localization.getString("initialize.messageLabel.notEmpty"));
|
||||
} catch (IOException ex) {
|
||||
LOG.error("I/O Exception", ex);
|
||||
messageLabel.setText(localization.getString("initialize.messageLabel.initializationFailed"));
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
******************************************************************************/
|
||||
package org.cryptomator.ui.controllers;
|
||||
|
||||
import static org.cryptomator.ui.util.DialogBuilderUtil.buildErrorDialog;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
@@ -20,6 +22,7 @@ import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
@@ -261,7 +264,18 @@ public class MainController implements ViewController {
|
||||
}
|
||||
try {
|
||||
final Path vaultDir = file.toPath();
|
||||
if (!Files.exists(vaultDir)) {
|
||||
if (Files.exists(vaultDir)) {
|
||||
try (Stream<Path> stream = Files.list(vaultDir)) {
|
||||
if (stream.filter(this::isNotHidden).findAny().isPresent()) {
|
||||
buildErrorDialog( //
|
||||
localization.getString("main.createVault.nonEmptyDir.title"), //
|
||||
localization.getString("main.createVault.nonEmptyDir.header"), //
|
||||
localization.getString("main.createVault.nonEmptyDir.content"), //
|
||||
ButtonType.OK).show();
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Files.createDirectory(vaultDir);
|
||||
}
|
||||
addVault(vaultDir, true);
|
||||
@@ -270,6 +284,10 @@ public class MainController implements ViewController {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isNotHidden(Path file) {
|
||||
return !file.getFileName().toString().startsWith(".");
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void didClickAddExistingVaults(ActionEvent event) {
|
||||
final FileChooser fileChooser = new FileChooser();
|
||||
|
||||
@@ -11,8 +11,6 @@ package org.cryptomator.ui.model;
|
||||
import java.io.IOException;
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
import java.nio.file.DirectoryNotEmptyException;
|
||||
import java.nio.file.DirectoryStream;
|
||||
import java.nio.file.FileAlreadyExistsException;
|
||||
import java.nio.file.FileSystem;
|
||||
import java.nio.file.Files;
|
||||
@@ -102,13 +100,6 @@ public class Vault {
|
||||
}
|
||||
|
||||
public void create(CharSequence passphrase) throws IOException {
|
||||
try (DirectoryStream<Path> stream = Files.newDirectoryStream(getPath())) {
|
||||
for (Path file : stream) {
|
||||
if (!file.getFileName().toString().startsWith(".")) {
|
||||
throw new DirectoryNotEmptyException(getPath().toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!isValidVaultDirectory()) {
|
||||
CryptoFileSystemProvider.initialize(getPath(), MASTERKEY_FILENAME, passphrase);
|
||||
} else {
|
||||
|
||||
@@ -16,6 +16,9 @@ main.addDirectory.contextMenu.open=Open Existing Vault
|
||||
main.directoryList.remove.confirmation.title=Remove Vault
|
||||
main.directoryList.remove.confirmation.header=Do you really want to remove this vault?
|
||||
main.directoryList.remove.confirmation.content=The vault will only be removed from the list. To permanently delete it, please delete the vault from your filesystem.
|
||||
main.createVault.nonEmptyDir.title=Creating vault failed
|
||||
main.createVault.nonEmptyDir.header=Chosen directory is not empty
|
||||
main.createVault.nonEmptyDir.content=The selected directory already contains files (possibly hidden). A vault can only be created in an empty directory.
|
||||
|
||||
# welcome.fxml
|
||||
welcome.checkForUpdates.label.currentlyChecking=Checking for Updates...
|
||||
@@ -26,7 +29,6 @@ initialize.label.password=Password
|
||||
initialize.label.retypePassword=Retype Password
|
||||
initialize.button.ok=Create Vault
|
||||
initialize.messageLabel.alreadyInitialized=Vault already initialized
|
||||
initialize.messageLabel.notEmpty=Vault not empty
|
||||
initialize.messageLabel.initializationFailed=Could not initialize vault. See log file for details.
|
||||
initialize.messageLabel.passwordStrength.0=Very weak
|
||||
initialize.messageLabel.passwordStrength.1=Weak
|
||||
|
||||
Reference in New Issue
Block a user