If You want to get the list of all the files that are uploaded on your DropBox then use the following code :
method -(void)downloadAllData:(void (^)(NSMutableArray *, NSMutableArray *, BOOL))
block need to be called after the successful login to DropBox, it will give you the two array one for folder and one for files.
-(void)downloadAllData:(void (^)(NSMutableArray *, NSMutableArray *, BOOL))block
{
dowloadDataBlock = block;
folderTypeArray=[[NSMutableArray alloc]init];
fileTypeArray=[[NSMutableArray alloc]init];;
restClient = [[DBRestClient alloc] initWithSession:dbSession];
metaData=@"/";
restClient.delegate=self;
[restClient loadMetadata:metaData];
}
- (void)restClient:(DBRestClient*)client loadedMetadata:(DBMetadata *)metadata
{
for (int i = 0; i < [metadata.contents count]; i++) {
DBMetadata *data = [metadata.contents objectAtIndex:i];
if (data.isDirectory)
[folderTypeArray addObject:data];
//Add folder object in your array
else
[fileTypeArray addObject:data];
}
dowloadDataBlock(fileTypeArray,folderTypeArray,YES);
}
0 Comment(s)