solve some todos

This commit is contained in:
Jan-Peter Klein
2025-06-04 10:47:56 +02:00
parent 968e8f51e4
commit 8c84720e24
2 changed files with 3 additions and 5 deletions

View File

@@ -28,7 +28,6 @@ public final class RecoveryDirectory implements AutoCloseable {
}
public static RecoveryDirectory create(Path vaultPath) throws IOException {
//TODO: Files.createTmpDirectory Doku lesen und ggf nutzen
Path recovery = addR(vaultPath);
Files.createDirectory(recovery);
return new RecoveryDirectory(vaultPath);
@@ -36,12 +35,12 @@ public final class RecoveryDirectory implements AutoCloseable {
public void moveRecoveredFiles() throws IOException {
Files.move(recoveryPath.resolve(MASTERKEY_FILENAME), vaultPath.resolve(MASTERKEY_FILENAME), StandardCopyOption.REPLACE_EXISTING);
Files.move(recoveryPath.resolve(VAULTCONFIG_FILENAME), vaultPath.resolve(VAULTCONFIG_FILENAME)); //TODO: ? StandardCopyOption.REPLACE_EXISTING
Files.move(recoveryPath.resolve(VAULTCONFIG_FILENAME), vaultPath.resolve(VAULTCONFIG_FILENAME), StandardCopyOption.REPLACE_EXISTING);
}
private void deleteRecoveryDirectory() {
try (var paths = Files.walk(recoveryPath)) {
paths.sorted(Comparator.reverseOrder()).forEach(p -> { //TODO: wieso reverseOrder
paths.sorted(Comparator.reverseOrder()).forEach(p -> {
try {
Files.delete(p);
} catch (IOException e) {

View File

@@ -128,12 +128,11 @@ public class RecoveryKeyResetPasswordController implements FxController {
if (!vaultListManager.containsVault(vault.getPath())) {
vaultListManager.add(vault.getPath());
}
window.close();
dialogs.prepareRecoverPasswordSuccess(window, owner, resourceBundle)
.setTitleKey("recoveryKey.recoverVaultConfig.title")
.setMessageKey("recoveryKey.recover.resetVaultConfigSuccess.message")
.build().showAndWait();
window.close();
} catch (IOException | CryptoException e) {
LOG.error("Recovery process failed", e);