From 0b5bd18d8525e16749ad422913800b2120021240 Mon Sep 17 00:00:00 2001 From: Alexander Tkachev Date: Thu, 14 Jul 2016 08:50:31 +0600 Subject: CLOUD: Update GoogleDriveStorage It now derives from IdStorage, so lots of GoogleDrive*Request classes are removed and replaced with generic IdStorage*Request ones. --- backends/cloud/googledrive/googledrivestorage.h | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) (limited to 'backends/cloud/googledrive/googledrivestorage.h') diff --git a/backends/cloud/googledrive/googledrivestorage.h b/backends/cloud/googledrive/googledrivestorage.h index 8093ef1938..435f9998a3 100644 --- a/backends/cloud/googledrive/googledrivestorage.h +++ b/backends/cloud/googledrive/googledrivestorage.h @@ -23,14 +23,14 @@ #ifndef BACKENDS_CLOUD_GOOGLEDRIVE_GOOGLEDRIVESTORAGE_H #define BACKENDS_CLOUD_GOOGLEDRIVE_GOOGLEDRIVESTORAGE_H -#include "backends/cloud/storage.h" +#include "backends/cloud/id/idstorage.h" #include "common/callback.h" #include "backends/networking/curl/curljsonrequest.h" namespace Cloud { namespace GoogleDrive { -class GoogleDriveStorage: public Cloud::Storage { +class GoogleDriveStorage: public Id::IdStorage { static char *KEY, *SECRET; static void loadKeyAndSecret(); @@ -49,11 +49,7 @@ class GoogleDriveStorage: public Cloud::Storage { /** Returns bool based on JSON response from cloud. */ void createDirectoryInnerCallback(BoolCallback outerCallback, Networking::JsonResponse json); - void printJson(Networking::JsonResponse response); void fileDownloaded(BoolResponse response); - void printFiles(FileArrayResponse response); - void printBool(BoolResponse response); - void printFile(UploadResponse response); void printInfo(StorageInfoResponse response); public: /** This constructor uses OAuth code flow to get tokens. */ @@ -81,12 +77,6 @@ public: /** Public Cloud API comes down there. */ - /** Returns StorageFile with the resolved file's id. */ - virtual Networking::Request *resolveFileId(Common::String path, UploadCallback callback, Networking::ErrorCallback errorCallback); - - /** Returns Array - the list of files. */ - virtual Networking::Request *listDirectory(Common::String path, ListDirectoryCallback callback, Networking::ErrorCallback errorCallback, bool recursive = false); - /** Returns Array - the list of files. */ virtual Networking::Request *listDirectoryById(Common::String id, ListDirectoryCallback callback, Networking::ErrorCallback errorCallback); @@ -94,18 +84,11 @@ public: virtual Networking::Request *upload(Common::String path, Common::SeekableReadStream *contents, UploadCallback callback, Networking::ErrorCallback errorCallback); /** Returns pointer to Networking::NetworkReadStream. */ - virtual Networking::Request *streamFile(Common::String path, Networking::NetworkReadStreamCallback callback, Networking::ErrorCallback errorCallback); virtual Networking::Request *streamFileById(Common::String id, Networking::NetworkReadStreamCallback callback, Networking::ErrorCallback errorCallback); - /** Calls the callback when finished. */ - virtual Networking::Request *download(Common::String remotePath, Common::String localPath, BoolCallback callback, Networking::ErrorCallback errorCallback); - /** Calls the callback when finished. */ virtual Networking::Request *remove(Common::String path, BoolCallback callback, Networking::ErrorCallback errorCallback) { return nullptr; } //TODO - /** Calls the callback when finished. */ - virtual Networking::Request *createDirectory(Common::String path, BoolCallback callback, Networking::ErrorCallback errorCallback); - /** Calls the callback when finished. */ virtual Networking::Request *createDirectoryWithParentId(Common::String parentId, Common::String name, BoolCallback callback, Networking::ErrorCallback errorCallback); @@ -126,6 +109,8 @@ public: */ static Common::String getAuthLink(); + virtual Common::String getRootDirectoryId(); + /** * Show message with GoogleDrive auth instructions. (Temporary) */ -- cgit v1.2.3