@@ -97,7 +97,7 @@ - (BFTask *)downloadFileAsyncWithState:(PFFileState *)fileState
97
97
98
98
BFTask *resultTask = [self _fileDownloadResultTaskForFileWithState: fileState];
99
99
if (!resultTask) {
100
- NSURL *url = [NSURL URLWithString: fileState.urlString ];
100
+ NSURL *url = [NSURL URLWithString: fileState.secureURLString ];
101
101
NSString *temporaryPath = [self _temporaryFileDownloadPathForFileState: fileState];
102
102
103
103
PFProgressBlock unifyingProgressBlock = [self _fileDownloadUnifyingProgressBlockForFileState: fileState];
@@ -116,13 +116,13 @@ - (BFTask *)downloadFileAsyncWithState:(PFFileState *)fileState
116
116
}];
117
117
}] continueWithBlock: ^id (BFTask *task) {
118
118
dispatch_barrier_async (_downloadDataAccessQueue, ^{
119
- [_downloadTasks removeObjectForKey: fileState.urlString ];
120
- [_downloadProgressBlocks removeObjectForKey: fileState.urlString ];
119
+ [_downloadTasks removeObjectForKey: fileState.secureURLString ];
120
+ [_downloadProgressBlocks removeObjectForKey: fileState.secureURLString ];
121
121
});
122
122
return task;
123
123
}];
124
124
dispatch_barrier_async (_downloadDataAccessQueue, ^{
125
- _downloadTasks[fileState.urlString ] = resultTask;
125
+ _downloadTasks[fileState.secureURLString ] = resultTask;
126
126
});
127
127
}
128
128
return resultTask;
@@ -152,7 +152,7 @@ - (BFTask *)downloadFileStreamAsyncWithState:(PFFileState *)fileState
152
152
- (BFTask *)_fileDownloadResultTaskForFileWithState : (PFFileState *)state {
153
153
__block BFTask *resultTask = nil ;
154
154
dispatch_sync (_downloadDataAccessQueue, ^{
155
- resultTask = _downloadTasks[state.urlString ];
155
+ resultTask = _downloadTasks[state.secureURLString ];
156
156
});
157
157
return resultTask;
158
158
}
@@ -162,7 +162,7 @@ - (PFProgressBlock)_fileDownloadUnifyingProgressBlockForFileState:(PFFileState *
162
162
dispatch_async (dispatch_get_global_queue (DISPATCH_QUEUE_PRIORITY_DEFAULT, 0 ), ^{
163
163
__block NSArray *blocks = nil ;
164
164
dispatch_sync (_downloadDataAccessQueue, ^{
165
- blocks = [_downloadProgressBlocks[fileState.urlString ] copy ];
165
+ blocks = [_downloadProgressBlocks[fileState.secureURLString ] copy ];
166
166
});
167
167
if (blocks.count != 0 ) {
168
168
dispatch_async (dispatch_get_main_queue (), ^{
@@ -181,18 +181,18 @@ - (void)_addFileDownloadProgressBlock:(PFProgressBlock)block forFileWithState:(P
181
181
}
182
182
183
183
dispatch_barrier_async (_downloadDataAccessQueue, ^{
184
- NSMutableArray *progressBlocks = _downloadProgressBlocks[state.urlString ];
184
+ NSMutableArray *progressBlocks = _downloadProgressBlocks[state.secureURLString ];
185
185
if (!progressBlocks) {
186
186
progressBlocks = [NSMutableArray arrayWithObject: block];
187
- _downloadProgressBlocks[state.urlString ] = progressBlocks;
187
+ _downloadProgressBlocks[state.secureURLString ] = progressBlocks;
188
188
} else {
189
189
[progressBlocks addObject: block];
190
190
}
191
191
});
192
192
}
193
193
194
194
- (NSString *)_temporaryFileDownloadPathForFileState : (PFFileState *)fileState {
195
- return [NSTemporaryDirectory () stringByAppendingPathComponent: PFMD5HashFromString (fileState.urlString )];
195
+ return [NSTemporaryDirectory () stringByAppendingPathComponent: PFMD5HashFromString (fileState.secureURLString )];
196
196
}
197
197
198
198
// /--------------------------------------
@@ -242,11 +242,11 @@ - (BFTask *)uploadFileAsyncWithState:(PFFileState *)fileState
242
242
// /--------------------------------------
243
243
244
244
- (NSString *)cachedFilePathForFileState : (PFFileState *)fileState {
245
- if (!fileState.urlString ) {
245
+ if (!fileState.secureURLString ) {
246
246
return nil ;
247
247
}
248
248
249
- NSString *filename = [fileState.urlString lastPathComponent ];
249
+ NSString *filename = [fileState.secureURLString lastPathComponent ];
250
250
NSString *path = [self .cacheFilesDirectoryPath stringByAppendingPathComponent: filename];
251
251
return path;
252
252
}
0 commit comments