From dc0a95617227c2a2489150aec69ec0c464cd30de Mon Sep 17 00:00:00 2001 From: Alexander Tkachev Date: Mon, 4 Jul 2016 15:11:07 +0600 Subject: CLOUD: Add CloudManager::downloadFolder() --- backends/cloud/cloudmanager.cpp | 11 +++++++++++ backends/cloud/cloudmanager.h | 3 +++ 2 files changed, 14 insertions(+) (limited to 'backends') diff --git a/backends/cloud/cloudmanager.cpp b/backends/cloud/cloudmanager.cpp index b9de6d48ab..0a5006ccef 100644 --- a/backends/cloud/cloudmanager.cpp +++ b/backends/cloud/cloudmanager.cpp @@ -226,6 +226,17 @@ Networking::Request *CloudManager::listDirectory(Common::String path, Storage::L return nullptr; } +Networking::Request *CloudManager::downloadFolder(Common::String remotePath, Common::String localPath, Storage::FileArrayCallback callback, Networking::ErrorCallback errorCallback, bool recursive) { + Storage *storage = getCurrentStorage(); + if (storage) storage->downloadFolder(remotePath, localPath, callback, errorCallback, recursive); + else { + delete callback; + delete errorCallback; + //TODO: should we call errorCallback? + } + return nullptr; +} + Networking::Request *CloudManager::info(Storage::StorageInfoCallback callback, Networking::ErrorCallback errorCallback) { Storage *storage = getCurrentStorage(); if (storage) storage->info(callback, errorCallback); diff --git a/backends/cloud/cloudmanager.h b/backends/cloud/cloudmanager.h index 70b32f0758..574c51a439 100644 --- a/backends/cloud/cloudmanager.h +++ b/backends/cloud/cloudmanager.h @@ -184,6 +184,9 @@ public: /** Returns ListDirectoryResponse with list of files. */ Networking::Request *listDirectory(Common::String path, Storage::ListDirectoryCallback callback, Networking::ErrorCallback errorCallback, bool recursive = false); + /** Returns Common::Array with list of files, which were not downloaded. */ + Networking::Request *downloadFolder(Common::String remotePath, Common::String localPath, Storage::FileArrayCallback callback, Networking::ErrorCallback errorCallback, bool recursive = false); + /** Return the StorageInfo struct. */ Networking::Request *info(Storage::StorageInfoCallback callback, Networking::ErrorCallback errorCallback); -- cgit v1.2.3