From 897da977d1909f83362446162bad70c22730f72d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20tom=20W=C3=B6rden?= <henrik@trineo.org>
Date: Mon, 23 Aug 2021 17:32:33 +0200
Subject: [PATCH] MAINT: rename Transaction::RetrieveAndDownloadFilesById

---
 doc/Examples.rst             | 4 ++--
 include/caosdb/transaction.h | 2 +-
 src/caosdb/transaction.cpp   | 4 ++--
 test/test_transaction.cpp    | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/doc/Examples.rst b/doc/Examples.rst
index ea65e02..ddb24e0 100644
--- a/doc/Examples.rst
+++ b/doc/Examples.rst
@@ -224,11 +224,11 @@ Up- and Download a file
   const auto &insert_results = insert_transaction->GetResultSet();
   const auto &inserted_file = insert_results.at(0);
 
-  // for the download you need to use the RetrieveAndDownloadFilesById task and
+  // for the download you need to use the RetrieveAndDownloadFileById task and
   // supply the path where the file shall be stored
   test_download_file = fs::path("test_download_file_delete_me.dat");
   auto download_transaction(connection->CreateTransaction());
-  download_transaction->RetrieveAndDownloadFilesById(
+  download_transaction->RetrieveAndDownloadFileById(
       inserted_file.GetId(), test_download_file.string());
   download_transaction->ExecuteAsynchronously();
   download_transaction->WaitForIt().GetCode()
diff --git a/include/caosdb/transaction.h b/include/caosdb/transaction.h
index 0fb724a..621c6cb 100644
--- a/include/caosdb/transaction.h
+++ b/include/caosdb/transaction.h
@@ -279,7 +279,7 @@ public:
    * If the file cannot be downloaded due to unsufficient permissions an error
    * is appended.
    */
-  auto RetrieveAndDownloadFilesById(const std::string &id, const std::string &local_path) noexcept
+  auto RetrieveAndDownloadFileById(const std::string &id, const std::string &local_path) noexcept
     -> StatusCode;
 
   /**
diff --git a/src/caosdb/transaction.cpp b/src/caosdb/transaction.cpp
index 5a7cb74..58bf54e 100644
--- a/src/caosdb/transaction.cpp
+++ b/src/caosdb/transaction.cpp
@@ -172,8 +172,8 @@ auto Transaction::RetrieveById(const std::string &id) noexcept -> StatusCode {
   return this->status.GetCode();
 }
 
-auto Transaction::RetrieveAndDownloadFilesById(const std::string &id,
-                                               const std::string &local_path) noexcept
+auto Transaction::RetrieveAndDownloadFileById(const std::string &id,
+                                              const std::string &local_path) noexcept
   -> StatusCode {
   ASSERT_CAN_ADD_RETRIEVAL
 
diff --git a/test/test_transaction.cpp b/test/test_transaction.cpp
index 21c00f8..db2d76a 100644
--- a/test/test_transaction.cpp
+++ b/test/test_transaction.cpp
@@ -199,7 +199,7 @@ TEST(test_transaction, test_retrieve_and_download) {
   auto transaction = connection.CreateTransaction();
 
   EXPECT_EQ(transaction->GetStatus().GetCode(), StatusCode::INITIAL);
-  transaction->RetrieveAndDownloadFilesById("asdf", "local_path");
+  transaction->RetrieveAndDownloadFileById("asdf", "local_path");
 
   EXPECT_EQ(transaction->GetStatus().GetCode(), StatusCode::GO_ON);
 
-- 
GitLab