use of bisq.common.proto.persistable.PersistableList in project bisq-desktop by bisq-network.
the class GUIUtil method exportAccounts.
public static void exportAccounts(ArrayList<PaymentAccount> accounts, String fileName, Preferences preferences, Stage stage, PersistenceProtoResolver persistenceProtoResolver) {
if (!accounts.isEmpty()) {
String directory = getDirectoryFromChooser(preferences, stage);
if (directory != null && !directory.isEmpty()) {
Storage<PersistableList<PaymentAccount>> paymentAccountsStorage = new Storage<>(new File(directory), persistenceProtoResolver);
paymentAccountsStorage.initAndGetPersisted(new PaymentAccountList(accounts), fileName, 100);
paymentAccountsStorage.queueUpForSave();
new Popup<>().feedback(Res.get("guiUtil.accountExport.savedToPath", Paths.get(directory, fileName).toAbsolutePath())).show();
}
} else {
new Popup<>().warning(Res.get("guiUtil.accountExport.noAccountSetup")).show();
}
}
Aggregations