@@ -290,14 +290,14 @@ - (instancetype)initWithConfiguration:(AWSServiceConfiguration *)serviceConfigur
290
290
delegateQueue: nil ];
291
291
292
292
// If not able to create the session, call completion handler with error and return nil.
293
- if (!_session ) {
293
+ if (!_session) {
294
294
NSString * message = [NSString stringWithFormat: @" Failed to create a NSURLSession for [%@ ]" , _sessionIdentifier];
295
295
NSDictionary *userInfo = [NSDictionary dictionaryWithObject: message
296
296
forKey: @" Message" ];
297
297
NSError *error = [NSError errorWithDomain: AWSS3TransferUtilityErrorDomain
298
298
code: AWSS3TransferUtilityErrorClientError
299
299
userInfo: userInfo];
300
- if (completionHandler ) {
300
+ if (completionHandler) {
301
301
completionHandler (error);
302
302
}
303
303
return nil ;
@@ -307,7 +307,7 @@ - (instancetype)initWithConfiguration:(AWSServiceConfiguration *)serviceConfigur
307
307
_configuration = [serviceConfiguration copy ];
308
308
[_configuration addUserAgentProductToken: AWSS3TransferUtilityUserAgent];
309
309
310
- if (transferUtilityConfiguration ) {
310
+ if (transferUtilityConfiguration) {
311
311
_transferUtilityConfiguration = [transferUtilityConfiguration copy ];
312
312
}
313
313
else {
@@ -363,15 +363,15 @@ - (void) hydrateFromDB:(NSMutableDictionary *) tempMultiPartMasterTaskDictionary
363
363
NSMutableArray *tasks = [AWSS3TransferUtilityDatabaseHelper getTransferTaskDataFromDB: _sessionIdentifier databaseQueue: _databaseQueue];
364
364
365
365
// Iterate through the tasks and populate transferRequests and Multipart dictionary.
366
- for ( NSMutableDictionary *task in tasks ) {
366
+ for ( NSMutableDictionary *task in tasks) {
367
367
NSString *transferType = [task objectForKey: @" transfer_type" ];
368
368
int sessionTaskID = [[task objectForKey: @" session_task_id" ] intValue ];
369
369
370
370
if ([transferType isEqualToString: @" UPLOAD" ]) {
371
371
AWSS3TransferUtilityUploadTask *transferUtilityUploadTask = [self hydrateUploadTask: task sessionIdentifier: self .sessionIdentifier databaseQueue: self .databaseQueue];
372
372
373
373
// If task is completed, no more processing is required.
374
- if (transferUtilityUploadTask.status == AWSS3TransferUtilityTransferStatusCompleted ) {
374
+ if (transferUtilityUploadTask.status == AWSS3TransferUtilityTransferStatusCompleted) {
375
375
[self .completedTaskDictionary setObject: transferUtilityUploadTask forKey: transferUtilityUploadTask.transferID];
376
376
[AWSS3TransferUtilityDatabaseHelper deleteTransferRequestFromDB: transferUtilityUploadTask.transferID databaseQueue: self .databaseQueue];
377
377
continue ;
@@ -384,7 +384,7 @@ - (void) hydrateFromDB:(NSMutableDictionary *) tempMultiPartMasterTaskDictionary
384
384
AWSS3TransferUtilityDownloadTask *transferUtilityDownloadTask = [self hydrateDownloadTask: task sessionIdentifier: self .sessionIdentifier databaseQueue: self .databaseQueue];
385
385
386
386
// If task is completed, no more processing is required.
387
- if (transferUtilityDownloadTask.status == AWSS3TransferUtilityTransferStatusCompleted ) {
387
+ if (transferUtilityDownloadTask.status == AWSS3TransferUtilityTransferStatusCompleted) {
388
388
[self .completedTaskDictionary setObject: transferUtilityDownloadTask forKey: transferUtilityDownloadTask.transferID];
389
389
[AWSS3TransferUtilityDatabaseHelper deleteTransferRequestFromDB: transferUtilityDownloadTask.transferID databaseQueue: self .databaseQueue];
390
390
continue ;
@@ -416,7 +416,7 @@ - (void) hydrateFromDB:(NSMutableDictionary *) tempMultiPartMasterTaskDictionary
416
416
417
417
// Get the Master MultiPart record from the Dictionary.
418
418
AWSS3TransferUtilityMultiPartUploadTask *multiPartUploadTask = [tempMultiPartMasterTaskDictionary objectForKey: subTask.uploadID];
419
- if ( !multiPartUploadTask ) {
419
+ if ( !multiPartUploadTask) {
420
420
// Couldn't find the multipart upload master record. Must be an orphan part record. Clean up the DB and continue.
421
421
[AWSS3TransferUtilityDatabaseHelper deleteTransferRequestFromDB: subTask.transferID databaseQueue: self .databaseQueue];
422
422
continue ;
@@ -441,7 +441,7 @@ - (void) linkTransfersToNSURLSession:(NSMutableDictionary *) tempMultiPartMaster
441
441
[self .session getTasksWithCompletionHandler: ^(NSArray *dataTasks, NSArray *uploadTasks, NSArray *downloadTasks) {
442
442
443
443
// Loop through all the upload Tasks.
444
- for ( NSURLSessionUploadTask *task in uploadTasks ) {
444
+ for ( NSURLSessionUploadTask *task in uploadTasks) {
445
445
AWSDDLogDebug (@" Iterating through task Identifier [%lu ]" , (unsigned long )task.taskIdentifier );
446
446
NSError *taskError = [task error ];
447
447
@@ -495,7 +495,7 @@ - (void) linkTransfersToNSURLSession:(NSMutableDictionary *) tempMultiPartMaster
495
495
}
496
496
497
497
// Loop through all the Download tasks
498
- for ( NSURLSessionDownloadTask *task in downloadTasks ) {
498
+ for ( NSURLSessionDownloadTask *task in downloadTasks) {
499
499
id obj = [tempTransferDictionary objectForKey: @(task.taskIdentifier)];
500
500
NSError *taskError = [task error ];
501
501
@@ -594,7 +594,7 @@ - (void)handleUnlinkedTransfers:(NSMutableDictionary *)tempMultiPartMasterTaskDi
594
594
{
595
595
AWSS3TransferUtilityUploadTask *transferUtilityUploadTask = obj;
596
596
597
- if (transferUtilityUploadTask.status == AWSS3TransferUtilityTransferStatusCompleted ) {
597
+ if (transferUtilityUploadTask.status == AWSS3TransferUtilityTransferStatusCompleted) {
598
598
[self .completedTaskDictionary setObject: transferUtilityUploadTask forKey: transferUtilityUploadTask.transferID];
599
599
600
600
// Delete the transfer record from the DB
@@ -626,7 +626,7 @@ - (void)handleUnlinkedTransfers:(NSMutableDictionary *)tempMultiPartMasterTaskDi
626
626
else if ([obj isKindOfClass: [AWSS3TransferUtilityDownloadTask class ]]) {
627
627
AWSS3TransferUtilityDownloadTask *downloadTask = obj;
628
628
629
- if (downloadTask.status == AWSS3TransferUtilityTransferStatusCompleted ) {
629
+ if (downloadTask.status == AWSS3TransferUtilityTransferStatusCompleted) {
630
630
[self .completedTaskDictionary setObject: downloadTask forKey: downloadTask.transferID];
631
631
[AWSS3TransferUtilityDatabaseHelper deleteTransferRequestFromDB: downloadTask.transferID taskIdentifier: [taskIdentifier integerValue ] databaseQueue: self .databaseQueue];
632
632
AWSDDLogDebug (@" Deleted transfer request from DB" );
@@ -929,7 +929,7 @@ - (NSURLSessionUploadTask *)getURLSessionUploadTaskWithRequest:(NSURLRequest *)
929
929
return [[self .preSignedURLBuilder getPreSignedURL: getPreSignedURLRequest] continueWithBlock: ^id (AWSTask *task) {
930
930
NSURL *presignedURL = task.result ;
931
931
NSError *error = task.error ;
932
- if ( error ) {
932
+ if (error) {
933
933
AWSDDLogError (@" Error: %@ " , error);
934
934
return [AWSTask taskWithError: error];
935
935
}
@@ -1173,7 +1173,7 @@ - (void) retryUpload: (AWSS3TransferUtilityUploadTask *) transferUtilityUploadTa
1173
1173
AWSS3CreateMultipartUploadOutput *output = task.result ;
1174
1174
1175
1175
// Check if the uploadId is null to safeguard from crash reported in https://github.com/aws/aws-sdk-ios/issues/1060
1176
- if (output.uploadId == (id ) [NSNull null ] || output.uploadId .length == 0 ) {
1176
+ if (output.uploadId == (id ) [NSNull null ] || output.uploadId .length == 0 ) {
1177
1177
AWSDDLogError (@" MultiPartUploadID is null - Failing Transfer" );
1178
1178
NSDictionary *userInfo = [NSDictionary dictionaryWithObject: @" MultiPartUploadID is null - Failing Transfer"
1179
1179
forKey: @" Message" ];
@@ -1485,7 +1485,7 @@ - (void)completeMultiPartForUploadTask:(AWSS3TransferUtilityMultiPartUploadTask
1485
1485
transferUtilityMultiPartUploadTask.status = AWSS3TransferUtilityTransferStatusCompleted;
1486
1486
1487
1487
transferUtilityMultiPartUploadTask.progress .completedUnitCount = transferUtilityMultiPartUploadTask.progress .totalUnitCount ;
1488
- if (transferUtilityMultiPartUploadTask.expression .progressBlock ) {
1488
+ if (transferUtilityMultiPartUploadTask.expression .progressBlock ) {
1489
1489
transferUtilityMultiPartUploadTask.expression .progressBlock (transferUtilityMultiPartUploadTask, transferUtilityMultiPartUploadTask.progress );
1490
1490
}
1491
1491
}
@@ -2125,7 +2125,7 @@ - (void)URLSession:(NSURLSession *)session
2125
2125
}
2126
2126
2127
2127
// Mark status as completed if there is no error.
2128
- if (! uploadTask.error ) {
2128
+ if (!uploadTask.error ) {
2129
2129
uploadTask.status = AWSS3TransferUtilityTransferStatusCompleted;
2130
2130
// Set progress to 100% and call the progress block
2131
2131
uploadTask.progress .completedUnitCount = uploadTask.progress .totalUnitCount ;
@@ -2222,7 +2222,7 @@ - (void)URLSession:(NSURLSession *)session
2222
2222
downloadTask.error = error;
2223
2223
}
2224
2224
2225
- if (!downloadTask.error ) {
2225
+ if (!downloadTask.error ) {
2226
2226
downloadTask.status = AWSS3TransferUtilityTransferStatusCompleted;
2227
2227
}
2228
2228
else {
@@ -2354,7 +2354,7 @@ - (void)URLSession:(NSURLSession *)session
2354
2354
totalSentSoFar += aSubTask.totalBytesSent ;
2355
2355
}
2356
2356
2357
- if (transferUtilityMultiPartUploadTask.progress .completedUnitCount != totalSentSoFar ) {
2357
+ if (transferUtilityMultiPartUploadTask.progress .completedUnitCount != totalSentSoFar) {
2358
2358
transferUtilityMultiPartUploadTask.progress .totalUnitCount = [transferUtilityMultiPartUploadTask.contentLength longLongValue ];
2359
2359
transferUtilityMultiPartUploadTask.progress .completedUnitCount = totalSentSoFar;
2360
2360
0 commit comments