我们如何检查dropbox v2中的文件或文件夹

时间:2018-04-02 10:49:36

标签: ios objective-c dropbox dropbox-api

我在dropbox api v2中检查主路径中的文件或文件夹 我正在尝试这种方法

我在obj c中的代码

DBUserClient *client = [DBClientsManager authorizedClient];

//NSString *searchPath = @"";
// "Full Dropbox" or "/Apps/<APP_NAME>/" if app has permission "App Folder").
[[client.filesRoutes listFolder:path]
 setResponseBlock:^(DBFILESListFolderResult *result, DBFILESListFolderError *routeError, DBRequestError *networkError) {
     if (result) {
         [self displayPhotos:result.entries];

     } else {

         NSString *title = @"";
         NSString *message = @"";
         if (routeError) {
             // Route-specific request error
             title = @"Route-specific error";
             if ([routeError isPath]) {
                 message = [NSString stringWithFormat:@"Invalid path: %@", routeError.path];
             }
         } else {
             // Generic request error
             title = @"Generic request error";
             if ([networkError isInternalServerError]) {
                 DBRequestInternalServerError *internalServerError = [networkError asInternalServerError];
                 message = [NSString stringWithFormat:@"%@", internalServerError];
             } else if ([networkError isBadInputError]) {
                 DBRequestBadInputError *badInputError = [networkError asBadInputError];
                 message = [NSString stringWithFormat:@"%@", badInputError];
             } else if ([networkError isAuthError]) {
                 DBRequestAuthError *authError = [networkError asAuthError];
                 message = [NSString stringWithFormat:@"%@", authError];
             } else if ([networkError isRateLimitError]) {
                 DBRequestRateLimitError *rateLimitError = [networkError asRateLimitError];
                 message = [NSString stringWithFormat:@"%@", rateLimitError];
             } else if ([networkError isHttpError]) {
                 DBRequestHttpError *genericHttpError = [networkError asHttpError];
                 message = [NSString stringWithFormat:@"%@", genericHttpError];
             } else if ([networkError isClientError]) {
                 DBRequestClientError *genericLocalError = [networkError asClientError];
                 message = [NSString stringWithFormat:@"%@", genericLocalError];
             }
         }

         UIAlertController *alertController =
         [UIAlertController alertControllerWithTitle:title
                                             message:message
                                      preferredStyle:(UIAlertControllerStyle)UIAlertControllerStyleAlert];
         [alertController addAction:[UIAlertAction actionWithTitle:@"OK"
                                                             style:(UIAlertActionStyle)UIAlertActionStyleCancel
                                                           handler:nil]];
         [self presentViewController:alertController animated:YES completion:nil];

         //[self setFinished];
     }
 }];

以上代码显示DBFILESListFolderResult中的结果,并保存到NSArray<DBFILESListFolderResult *> *arr 现在结果显示.tag =文件/文件夹但是无法获取变量请帮助我如何获取此标记并保存在变量中 现在我的结果是## Result ##

{
cursor = "AAG_UmQvZ1am1-D_sQ9Vu7rufWd2JQ8GNNk16EDpcKW5PtUuhpzJTZhNoTPIPQ3-_clzcJh2ixtkEqy_8rMzpLyumkgu851X3752-NczhJiTpp0t-lWSme20htOgCVso9l_1tbjf-jBJEEB2JxSdeHlu7byifT74fT7EepYRO7Si4FQcUHSDoGhTsGHV3rGuqFU";
entries =     (
            {
        ".tag" = folder;
        id = "id:qPwKdoK_nCAAAAAAAAAABg";
        name = "IPA File";
        "path_display" = "/IPA File";
        "path_lower" = "/ipa file";
        "shared_folder_id" = 1493424685;
        "sharing_info" =             {
            "no_access" = 0;
            "read_only" = 0;
            "shared_folder_id" = 1493424685;
            "traverse_only" = 0;
        };
    },
            {
        ".tag" = folder;
        id = "id:qPwKdoK_nCAAAAAAAAC2pA";
        name = ali;
        "path_display" = "/ali";
        "path_lower" = "/ali";
    },
            {
        ".tag" = file;
        "client_modified" = "2017-10-17T06:56:43Z";
        "content_hash" = a266bbb3f8a11c095fbe4a94647df343dbede5d90635065b5ae84e96d937d3bb;
        id = "id:qPwKdoK_nCAAAAAAAAC2mA";
        name = "OpenHouseID.zip";
        "path_display" = "/OpenHouseID.zip";
        "path_lower" = "/openhouseid.zip";
        rev = 155f1577317c2;
        "server_modified" = "2017-10-17T08:15:35Z";
        size = 354077251;
    },
            {
        ".tag" = file;
        "client_modified" = "2017-10-17T06:55:21Z";
        "content_hash" = f8fa98bdcb232ca9040feeb16ea25fb4a355c061a2c275eedb48eacfa98bc909;
        id = "id:qPwKdoK_nCAAAAAAAAC2mQ";
        name = "Latest With PushNotifications.zip";
        "path_display" = "/Latest With PushNotifications.zip";
        "path_lower" = "/latest with pushnotifications.zip";
        rev = 155f2577317c2;
        "server_modified" = "2017-10-17T09:43:52Z";
        size = 375600989;
    }
       );
    "has_more" = 0;
}

0 个答案:

没有答案