|
|
@@ -254,18 +254,22 @@
|
|
|
//NSData *fileData = [NSData dataWithContentsOfURL:newURL options:NSDataReadingMappedIfSafe error:&error];
|
|
|
if (error) {
|
|
|
// 读取出错
|
|
|
+ if(self.nasFullPath){
|
|
|
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(20 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
|
|
+ [self checkSaveNasFileAgainFun];
|
|
|
+ });
|
|
|
+ }
|
|
|
} else {
|
|
|
NSLog(@"222 fileName : %@", fileName);
|
|
|
if(!self.nasFullPath){
|
|
|
- // 下载
|
|
|
+ // websock下载流程
|
|
|
[cachesFileManager removeItemAtPath:fileName type:DownLoadFileType error:nil];
|
|
|
}
|
|
|
else{
|
|
|
-
|
|
|
+ //nas下载流程
|
|
|
[[NSFileManager defaultManager] removeItemAtPath:self.nasFullPath error:nil];
|
|
|
[[boxDownloadFileManager shareInstance] deleteDownloadDonePlistInfoBy:self.nasFullPath];
|
|
|
- self.nasFullPath = nil;
|
|
|
- [[boxDownloadFileManager shareInstance] checkDownloadDonePlistInfoFun];
|
|
|
+ [self checkSaveNasFileAgainFun];
|
|
|
}
|
|
|
|
|
|
}
|
|
|
@@ -273,8 +277,18 @@
|
|
|
[urls.firstObject stopAccessingSecurityScopedResource];
|
|
|
} else {
|
|
|
// 授权失败
|
|
|
+ if(self.nasFullPath){
|
|
|
+ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(20 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
|
|
+ [self checkSaveNasFileAgainFun];
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+#pragma mark 再次读取下载完成数据做保存操作
|
|
|
+- (void)checkSaveNasFileAgainFun
|
|
|
+{
|
|
|
+ self.nasFullPath = nil;
|
|
|
+ [[boxDownloadFileManager shareInstance] checkDownloadDonePlistInfoFun];
|
|
|
+}
|
|
|
@end
|