CLOUD: Add OneDriveUploadRequest

Doesn't support server's requested ranges yet.

Commit also adds some PUT-related code in NetworkReadStream and
CurlRequest.
This commit is contained in:
Alexander Tkachev 2016-05-31 14:18:32 +06:00
parent eb63b50b7f
commit b39f46788a
14 changed files with 354 additions and 33 deletions

View file

@ -131,19 +131,6 @@ Networking::Request *DropboxStorage::upload(Common::String path, Common::Seekabl
return ConnMan.addRequest(new DropboxUploadRequest(_token, path, contents, callback, errorCallback));
}
Networking::Request *DropboxStorage::upload(Common::String remotePath, Common::String localPath, UploadCallback callback, Networking::ErrorCallback errorCallback) {
Common::File *f = new Common::File();
if (!f->open(localPath)) {
warning("DropboxStorage: unable to open file to upload from");
if (errorCallback) (*errorCallback)(Networking::ErrorResponse(nullptr, false, true, "", -1));
delete errorCallback;
delete callback;
delete f;
return nullptr;
}
return upload(remotePath, f, callback, errorCallback);
}
Networking::Request *DropboxStorage::streamFile(Common::String path, Networking::NetworkReadStreamCallback callback, Networking::ErrorCallback errorCallback) {
Common::JSONObject jsonRequestParameters;
jsonRequestParameters.setVal("path", new Common::JSONValue(path));