This project is read-only.

To get metadata about a file, the metadata function is used.

void GetMetaData(string path)
{
	// Subscribe to metadata complete event
	dropboxClient.MetadataComplete += new WP7Dropbox.metadata_complete(MetadataComplete);
	// Get metadata for the path
	dropboxClient.metadata(path);
}
void MetadataComplete(FolderMetadata response)
{
	// response.Contents contains a list of files
	// response itself contains metadata for the file/folder specified
	ObservableCollection<FileMetadata> Files = response.Contents;
	dropboxClient.MetadataComplete -= new WP7Dropbox.metadata_complete(oauthRequest_MetadataComplete);
}

metadata caches each path request in IsolatedStorage, and then when called it uses the Hash parameter from the cached metadata. If it matches, Dropbox returns a "304 - not modified" status code, and MetadataComplete gets fired with the cached metadata, otherwise, new metadata is downloaded and parsed.

The data supplied should therefore always be up to date, but should have the best balance between speed (cached responses will be faster) and network load (very little data gets sent/received if hashes matched).

Last edited Sep 2, 2010 at 4:03 PM by l3v5y, version 1

Comments

easter_bunny Jul 22, 2011 at 2:29 AM 
You want to make sure you are referencing the correct file (the most recent version has a but) but then a file located at the root of the directory would simply be in path = "/desiredFile.txt" or in "/directory/file.txt"

bradhuffman Feb 4, 2011 at 3:30 AM 
What would the proper path to return the contents of the root directory be? I've gotten a user token back, and am trying to wrap my head around actually retrieving data at this point. Any insight would be greatly appreciated.