CLOUD: Add DropboxStorage::listDirectory sketch
It doesn't support any "has_more", doesn't call user's callback and just prints JSON instead of parsing in into an array of files. I believe it would become DropboxListDirectoryRequest in the next commit.
This commit is contained in:
parent
a439bd4c33
commit
735db74b90
4 changed files with 36 additions and 8 deletions
|
@ -70,10 +70,12 @@ bool CurlJsonRequest::handle() {
|
|||
|
||||
if (_stream->eos()) {
|
||||
if (_stream->httpResponseCode() != 200)
|
||||
warning("HTTP response code is not 200 OK");
|
||||
warning("HTTP response code is not 200 OK (it's %d)", _stream->httpResponseCode());
|
||||
|
||||
if (_callback) {
|
||||
char *contents = getPreparedContents();
|
||||
char *contents = getPreparedContents();
|
||||
if (_stream->httpResponseCode() != 200)
|
||||
debug("%s", contents);
|
||||
Common::JSONValue *json = Common::JSON::parse(contents);
|
||||
(*_callback)(json); //potential memory leak, free it in your callbacks!
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue