@@ -97,7 +97,7 @@ - (BFTask *)downloadFileAsyncWithState:(PFFileState *)fileState
9797
9898 BFTask *resultTask = [self _fileDownloadResultTaskForFileWithState: fileState];
9999 if (!resultTask) {
100- NSURL *url = [NSURL URLWithString: fileState.urlString ];
100+ NSURL *url = [NSURL URLWithString: fileState.secureURLString ];
101101 NSString *temporaryPath = [self _temporaryFileDownloadPathForFileState: fileState];
102102
103103 PFProgressBlock unifyingProgressBlock = [self _fileDownloadUnifyingProgressBlockForFileState: fileState];
@@ -116,13 +116,13 @@ - (BFTask *)downloadFileAsyncWithState:(PFFileState *)fileState
116116 }];
117117 }] continueWithBlock: ^id (BFTask *task) {
118118 dispatch_barrier_async (_downloadDataAccessQueue, ^{
119- [_downloadTasks removeObjectForKey: fileState.urlString ];
120- [_downloadProgressBlocks removeObjectForKey: fileState.urlString ];
119+ [_downloadTasks removeObjectForKey: fileState.secureURLString ];
120+ [_downloadProgressBlocks removeObjectForKey: fileState.secureURLString ];
121121 });
122122 return task;
123123 }];
124124 dispatch_barrier_async (_downloadDataAccessQueue, ^{
125- _downloadTasks[fileState.urlString ] = resultTask;
125+ _downloadTasks[fileState.secureURLString ] = resultTask;
126126 });
127127 }
128128 return resultTask;
@@ -152,7 +152,7 @@ - (BFTask *)downloadFileStreamAsyncWithState:(PFFileState *)fileState
152152- (BFTask *)_fileDownloadResultTaskForFileWithState : (PFFileState *)state {
153153 __block BFTask *resultTask = nil ;
154154 dispatch_sync (_downloadDataAccessQueue, ^{
155- resultTask = _downloadTasks[state.urlString ];
155+ resultTask = _downloadTasks[state.secureURLString ];
156156 });
157157 return resultTask;
158158}
@@ -162,7 +162,7 @@ - (PFProgressBlock)_fileDownloadUnifyingProgressBlockForFileState:(PFFileState *
162162 dispatch_async (dispatch_get_global_queue (DISPATCH_QUEUE_PRIORITY_DEFAULT, 0 ), ^{
163163 __block NSArray *blocks = nil ;
164164 dispatch_sync (_downloadDataAccessQueue, ^{
165- blocks = [_downloadProgressBlocks[fileState.urlString ] copy ];
165+ blocks = [_downloadProgressBlocks[fileState.secureURLString ] copy ];
166166 });
167167 if (blocks.count != 0 ) {
168168 dispatch_async (dispatch_get_main_queue (), ^{
@@ -181,18 +181,18 @@ - (void)_addFileDownloadProgressBlock:(PFProgressBlock)block forFileWithState:(P
181181 }
182182
183183 dispatch_barrier_async (_downloadDataAccessQueue, ^{
184- NSMutableArray *progressBlocks = _downloadProgressBlocks[state.urlString ];
184+ NSMutableArray *progressBlocks = _downloadProgressBlocks[state.secureURLString ];
185185 if (!progressBlocks) {
186186 progressBlocks = [NSMutableArray arrayWithObject: block];
187- _downloadProgressBlocks[state.urlString ] = progressBlocks;
187+ _downloadProgressBlocks[state.secureURLString ] = progressBlocks;
188188 } else {
189189 [progressBlocks addObject: block];
190190 }
191191 });
192192}
193193
194194- (NSString *)_temporaryFileDownloadPathForFileState : (PFFileState *)fileState {
195- return [NSTemporaryDirectory () stringByAppendingPathComponent: PFMD5HashFromString (fileState.urlString )];
195+ return [NSTemporaryDirectory () stringByAppendingPathComponent: PFMD5HashFromString (fileState.secureURLString )];
196196}
197197
198198// /--------------------------------------
@@ -242,11 +242,11 @@ - (BFTask *)uploadFileAsyncWithState:(PFFileState *)fileState
242242// /--------------------------------------
243243
244244- (NSString *)cachedFilePathForFileState : (PFFileState *)fileState {
245- if (!fileState.urlString ) {
245+ if (!fileState.secureURLString ) {
246246 return nil ;
247247 }
248248
249- NSString *filename = [fileState.urlString lastPathComponent ];
249+ NSString *filename = [fileState.secureURLString lastPathComponent ];
250250 NSString *path = [self .cacheFilesDirectoryPath stringByAppendingPathComponent: filename];
251251 return path;
252252}
0 commit comments