|
@@ -20,6 +20,10 @@ static NSMutableDictionary *_downloadList;
|
|
|
if (account.length != 0)
|
|
|
{
|
|
|
NSString *fileFolder = [HWDataManager documentPathForAccount:account fileFolder:KCustomDownloadDirector];
|
|
|
+ // 创建文件储存路径
|
|
|
+ if (![[NSFileManager defaultManager] fileExistsAtPath:fileFolder]) {
|
|
|
+ [[NSFileManager defaultManager] createDirectoryAtPath:fileFolder withIntermediateDirectories:YES attributes:nil error:nil];
|
|
|
+ }
|
|
|
return fileFolder;
|
|
|
}else {
|
|
|
HLog(@"创建下载plist文件失败!");
|
|
@@ -27,6 +31,26 @@ static NSMutableDictionary *_downloadList;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+/** 上传的fullPath 是不能用的 要改新的*/
|
|
|
++ (NSString *)getFullPathByOldFullPath:(NSString*)fullPath
|
|
|
+{
|
|
|
+ NSArray *pathArr= [fullPath componentsSeparatedByString:@"/"];
|
|
|
+ NSString * fileName= @"";
|
|
|
+
|
|
|
+ if(pathArr && pathArr.count >0){
|
|
|
+ fileName = pathArr.lastObject;
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ return @"";
|
|
|
+ }
|
|
|
+
|
|
|
+ NSString* fileFullDir = [customDownloadCacheManager getFullDirector];
|
|
|
+ NSString* curFullPath = [fileFullDir stringByAppendingPathComponent:fileName];
|
|
|
+
|
|
|
+ return curFullPath;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
/** 查询当前文件下载了多少 */
|
|
|
+ (int64_t)getFileSizeWithURL:(NSString *)url
|
|
|
{
|