@@ -433,23 +433,22 @@ - (void) hydrateFromDB:(NSMutableDictionary *) tempMultiPartMasterTaskDictionary
433433 }
434434}
435435
436- - (void ) linkTransfersToNSURLSession : (NSMutableDictionary *) tempMultiPartMasterTaskDictionary
437- tempTransferDictionary : (NSMutableDictionary *) tempTransferDictionary
438- completionHandler : (void (^)(NSError *_Nullable error)) completionHandler {
436+ - (void )linkTransfersToNSURLSession : (NSMutableDictionary *) tempMultiPartMasterTaskDictionary
437+ tempTransferDictionary : (NSMutableDictionary *)tempTransferDictionary
438+ completionHandler : (void (^)(NSError *_Nullable error)) completionHandler {
439439 // Get tasks from the NSURLSession and reattach to them.
440440 // getTasksWithCompletionHandler is an ansynchronous task, so the thread that is calling this method will not be blocked.
441441 [self .session getTasksWithCompletionHandler: ^(NSArray *dataTasks, NSArray *uploadTasks, NSArray *downloadTasks) {
442-
442+
443443 // Loop through all the upload Tasks.
444- for ( NSURLSessionUploadTask *task in uploadTasks) {
444+ for ( NSURLSessionUploadTask *task in uploadTasks) {
445445 AWSDDLogDebug (@" Iterating through task Identifier [%lu ]" , (unsigned long )task.taskIdentifier );
446446 NSError *taskError = [task error ];
447-
447+
448448 // Get the Task
449449 id obj = [tempTransferDictionary objectForKey: @(task.taskIdentifier)];
450-
451- if ([obj isKindOfClass: [AWSS3TransferUtilityUploadTask class ]])
452- {
450+
451+ if ([obj isKindOfClass: [AWSS3TransferUtilityUploadTask class ]]) {
453452 // Found a upload task.
454453 AWSS3TransferUtilityUploadTask *uploadTask = obj;
455454 uploadTask.sessionTask = task;
@@ -469,11 +468,11 @@ - (void) linkTransfersToNSURLSession:(NSMutableDictionary *) tempMultiPartMaster
469468 filePath: uploadTask.file];
470469 continue ;
471470 }
472-
471+
473472 // Check if it is InProgress
474473 if (uploadTask.status == AWSS3TransferUtilityTransferStatusInProgress) {
475474 // Check if the the underlying NSURLSession task is completed. If so, delete the record from the DB, clean up any temp files and call the completion handler.
476- if ([ task state ] == NSURLSessionTaskStateCompleted ) {
475+ if (task. state == NSURLSessionTaskStateCompleted ) {
477476 // Set progress to 100%
478477 uploadTask.progress .completedUnitCount = uploadTask.progress .totalUnitCount ;
479478 uploadTask.status = AWSS3TransferUtilityTransferStatusCompleted;
@@ -484,7 +483,7 @@ - (void) linkTransfersToNSURLSession:(NSMutableDictionary *) tempMultiPartMaster
484483 continue ;
485484 }
486485 // If it is in any other status than running, then we need to recover by retrying.
487- if ([ task state ] != NSURLSessionTaskStateRunning ) {
486+ if (task. state != NSURLSessionTaskStateRunning ) {
488487 // We think the task in IN_PROGRESS. The underlying task is not running.
489488 // Recover the situation by retrying.
490489 [self retryUpload: uploadTask];
@@ -522,15 +521,15 @@ - (void) linkTransfersToNSURLSession:(NSMutableDictionary *) tempMultiPartMaster
522521 // Check if this is in progress
523522 if (downloadTask.status == AWSS3TransferUtilityTransferStatusInProgress) {
524523
525- if ([ task state ] == NSURLSessionTaskStateCompleted ) {
524+ if (task. state == NSURLSessionTaskStateCompleted ) {
526525 // Set progress to 100%
527526 downloadTask.progress .completedUnitCount = downloadTask.progress .totalUnitCount ;
528527 downloadTask.status = AWSS3TransferUtilityTransferStatusCompleted;
529528 [self markTransferAsCompleted: downloadTask taskError: taskError temporaryFileCreated: NO filePath: @" " ];
530529 continue ;
531530 }
532531 // Check if the underlying task's status is not in Progress.
533- else if ([ task state ] != NSURLSessionTaskStateRunning ) {
532+ else if (task. state != NSURLSessionTaskStateRunning ) {
534533 // We think the task in Progress. The underlying task is not in progress.
535534 // Recover the situation by retrying
536535 [self retryDownload: downloadTask];
@@ -716,10 +715,9 @@ - (AWSS3TransferUtilityDownloadTask *)hydrateDownloadTask:(NSMutableDictionary *
716715}
717716
718717
719- -( AWSS3TransferUtilityMultiPartUploadTask *) hydrateMultiPartUploadTask : (NSMutableDictionary *) task
720- sessionIdentifier : (NSString *) sessionIdentifier
721- databaseQueue : (AWSFMDatabaseQueue *) databaseQueue
722- {
718+ - (AWSS3TransferUtilityMultiPartUploadTask *)hydrateMultiPartUploadTask : (NSMutableDictionary *) task
719+ sessionIdentifier : (NSString *) sessionIdentifier
720+ databaseQueue : (AWSFMDatabaseQueue *) databaseQueue {
723721 AWSS3TransferUtilityMultiPartUploadTask *transferUtilityMultiPartUploadTask = [AWSS3TransferUtilityMultiPartUploadTask new ];
724722 [transferUtilityMultiPartUploadTask integrateWithTransferUtility: self ];
725723 transferUtilityMultiPartUploadTask.nsURLSessionID = sessionIdentifier;
0 commit comments