mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-22 04:31:27 +00:00
cleanup
This commit is contained in:
@@ -413,6 +413,7 @@ public class Vault {
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the cleartext name from a given path to an encrypted vault file
|
||||
*/
|
||||
public String getCleartextName(Path ciphertextPath) throws IOException {
|
||||
if (!state.getValue().equals(VaultState.Value.UNLOCKED)) {
|
||||
|
||||
@@ -27,9 +27,7 @@ import javafx.beans.property.ReadOnlyObjectProperty;
|
||||
import javafx.beans.property.SimpleBooleanProperty;
|
||||
import javafx.beans.value.ObservableValue;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.Alert;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.ButtonType;
|
||||
import javafx.scene.input.Clipboard;
|
||||
import javafx.scene.input.ClipboardContent;
|
||||
import javafx.scene.input.DataFormat;
|
||||
@@ -168,7 +166,7 @@ public class VaultDetailUnlockedController implements FxController {
|
||||
}
|
||||
|
||||
private void copyDecryptedNamesToClipboard(List<CipherToCleartext> mapping) {
|
||||
if(mapping.size() == 1) {
|
||||
if (mapping.size() == 1) {
|
||||
Clipboard.getSystemClipboard().setContent(Map.of(DataFormat.PLAIN_TEXT, mapping.getFirst().cleartext));
|
||||
} else {
|
||||
var content = mapping.stream().map(CipherToCleartext::toString).collect(Collectors.joining("\n"));
|
||||
@@ -262,12 +260,13 @@ public class VaultDetailUnlockedController implements FxController {
|
||||
vaultStats.getUnchecked(vault.get()).showVaultStatisticsWindow();
|
||||
}
|
||||
|
||||
record CipherToCleartext (String ciphertext, String cleartext) {
|
||||
record CipherToCleartext(String ciphertext, String cleartext) {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return ciphertext + " > " + cleartext;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/* Getter/Setter */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user