CLOUD: Update downloading in Storages

Id should be used everywhere.
This commit is contained in:
Alexander Tkachev 2016-06-08 13:02:49 +06:00
parent 60add0df1b
commit f0d61084da
10 changed files with 39 additions and 17 deletions

View file

@ -27,8 +27,8 @@
namespace Cloud {
DownloadRequest::DownloadRequest(Storage *storage, Storage::BoolCallback callback, Networking::ErrorCallback ecb, Common::String remoteFile, Common::DumpFile *dumpFile):
Request(nullptr, ecb), _boolCallback(callback), _localFile(dumpFile), _remoteFileName(remoteFile), _storage(storage),
DownloadRequest::DownloadRequest(Storage *storage, Storage::BoolCallback callback, Networking::ErrorCallback ecb, Common::String remoteFileId, Common::DumpFile *dumpFile):
Request(nullptr, ecb), _boolCallback(callback), _localFile(dumpFile), _remoteFileId(remoteFileId), _storage(storage),
_remoteFileStream(nullptr), _workingRequest(nullptr), _ignoreCallback(false) {
start();
}
@ -47,8 +47,8 @@ void DownloadRequest::start() {
//TODO: reopen DumpFile
_ignoreCallback = false;
_workingRequest = _storage->streamFile(
_remoteFileName,
_workingRequest = _storage->streamFileById(
_remoteFileId,
new Common::Callback<DownloadRequest, Networking::NetworkReadStreamResponse>(this, &DownloadRequest::streamCallback),
new Common::Callback<DownloadRequest, Networking::ErrorResponse>(this, &DownloadRequest::streamErrorCallback)
);