对象存储 OSS罗列bucket中的文件
详细解答可以参考官方帮助文档OSSGetBucketRequest * getBucket = [OSSGetBucketRequest new];getBucket.bucketName = @'';// getBucket.marker = @'';// getBucket.prefix = @'';// getBucket.delimiter = @'';OSSTask * getBucketTask = [client getBucket:getBucket];[getBucketTask continueWithBlock:^id(OSSTask *task) { if (!task.error) { OSSGetBucketResult * result = task.result; NSLog(@'get bucket success!'); for (NSDictionary * objectInfo in result.contents) { NSLog(@'list object: %@', objectInfo); } } else { NSLog(@'get bucket failed, error: %@', task.error); } return nil;}];
上述代码罗列了Bucket中的文件
罗列操作必须具备访问该Bukcet的权限。罗列时,可以通过prefix,marker,delimiter和max-keys对list做限定,返回部分结果。
赞0
踩1