Product Overview
Feature Description
Product Strengths
Use Cases
Basic Concept
API | Operation Description |
Batch Copy Files |
QCloudSMHBatchCopyRequest *req = [QCloudSMHBatchCopyRequest new];req.spaceId = @"spaceId";req.libraryId = @"libraryId";// parameter is required to implement the save network disk featurereq.shareAccessToken = @"shareAccessToken";QCloudSMHBatchCopyInfo *info = [QCloudSMHBatchCopyInfo new];// original pathinfo.from = @"from";// target pathinfo.to = @"target";// The fromLibraryId and fromSpaceId parameters are used to implement the save network disk feature and must be used with shareAccessToken.info.fromLibraryId = @"fromLibraryId";info.fromSpaceId = @"fromSpaceId";// whether move permissioninfo.moveAuthority = YES;// Resolve when file name conflicts with target pathinfo.conflictStrategy = QCloudSMHConflictStrategyEnumRename;req.batchInfos = @[info];[req setFinishBlock:^(QCloudSMHBatchResult *result, NSError * _Nullable error) {//if it is a sync task, obtain the task status from the http status codeQCloudSMHBatchTaskStatus status = QCloudSMHBatchTaskStatusTypeFromStatus([result __originHTTPURLResponse__].statusCode);result.status = status;if(status != QCloudSMHBatchTaskStatusWating || error){// End when task status is not wait or there is an errorif(self.finishBlock){self.finishBlock(result, error);}}else{// Use the returned taskid to poll task statusresult.taskId;}}];[[QCloudSMHService defaultSMHService]batchCopy:req];
QCloudGetTaskStatusRequest *req = [QCloudGetTaskStatusRequest new];req.spaceId = @"spaceId";req.libraryId = @"libraryId";// taskId returned from the previous stepreq.taskIdList = @[taskId];[req setFinishBlock:^(NSArray * _Nonnull result, NSError * _Nonnull error) {}];[[QCloudSMHService defaultSMHService] getTaskStatus:req];
QCloudSMHCopyObjectRequest *req = [QCloudSMHCopyObjectRequest new];req.libraryId = @"libraryId";req.spaceId = @"spaceId";// shareAccessToken is required to save the network diskreq.shareAccessToken = @"shareAccessToken";QCloudSMHBatchCopyInfo *info = [QCloudSMHBatchCopyInfo new];// source pathinfo.from = @"fromPath";// target pathinfo.to = @"toPath";info.conflictStrategy = QCloudSMHConflictStrategyEnumRename;// shareAccessToken fromSpaceId fromLibraryId are required to save the network diskif (shareAccessToken) {info.fromSpaceId = @"fromSpaceId";info.fromLibraryId = @"fromLibraryId";}req.batchInfos = @[info];[req setFinishBlock:^(QCloudSMHBatchResult *result, NSError *_Nullable error) {}];[[QCloudSMHService defaultSMHService] copyObject:req];
Apakah halaman ini membantu?
Anda juga dapat Menghubungi Penjualan atau Mengirimkan Tiket untuk meminta bantuan.
masukan