Parcourir la source

1.去掉不用的第三方

huangxiaodong il y a 2 mois
Parent
commit
94e72f8df2

+ 0 - 7
创维盒子/code/AppDelegate/PrefixHeader.pch

@@ -160,12 +160,5 @@ isBangsScreen; \
 #define DB_HWBuryPointModelList_TableName   @"DB_HWBuryPointModelList_New"
 
 
-#pragma mark - 云盘文件缓存路径
-/**云盘文件下载-文件缓存路径*/
-#define kPath_YunPan_Download_Folder  [HWDataManager cachesPathForAccount:ksharedAppDelegate.DeviceThirdIdMod.data.sn fileFolder:@"download"]
-
-/**云盘文件上传-文件缓存路径*/
-#define kPath_YunPan_Upload_Folder    [HWDataManager cachesPathForAccount:ksharedAppDelegate.DeviceThirdIdMod.data.sn fileFolder:@"Upload"]
-
 
 #endif /* PrefixHeader_pch */

+ 0 - 184
创维盒子/code/Vendor/UploadManager/CWUploadManage/CWFileManager.h

@@ -1,184 +0,0 @@
-//
-//  CWUploadTask.m
-//  uploadFileDemo
-//
-//  Created by hyjet on 2018/3/9.
-//  Copyright © 2018年 uploadFileDemo. All rights reserved.
-//
-#import <UIKit/UIKit.h>
-
-//#define uploadPlist @"uploadPlist/upload.plist"
-
-@interface CWFileManager : NSObject
-
-#pragma mark - 沙盒目录相关
-// 沙盒的主目录路径
-+ (NSString *)homeDir;
-// 沙盒中Documents的目录路径
-+ (NSString *)documentsDir;
-// 沙盒中Library的目录路径
-+ (NSString *)libraryDir;
-// 沙盒中Libarary/Preferences的目录路径
-+ (NSString *)preferencesDir;
-// 沙盒中Library/Caches的目录路径
-+ (NSString *)cachesDir;
-// 沙盒中tmp的目录路径
-+ (NSString *)tmpDir;
-
-#pragma mark - 遍历文件夹
-/**
- 文件遍历
- 
- @param path 目录的绝对路径
- @param deep 是否深遍历 (1. 浅遍历:返回当前目录下的所有文件和文件夹;
- 2. 深遍历:返回当前目录下及子目录下的所有文件和文件夹)
- @return 遍历结果数组
- */
-+ (NSArray *)listFilesInDirectoryAtPath:(NSString *)path deep:(BOOL)deep;
-// 遍历沙盒主目录
-+ (NSArray *)listFilesInHomeDirectoryByDeep:(BOOL)deep;
-// 遍历Documents目录
-+ (NSArray *)listFilesInDocumentDirectoryByDeep:(BOOL)deep;
-// 遍历Library目录
-+ (NSArray *)listFilesInLibraryDirectoryByDeep:(BOOL)deep;
-// 遍历Caches目录
-+ (NSArray *)listFilesInCachesDirectoryByDeep:(BOOL)deep;
-// 遍历tmp目录
-+ (NSArray *)listFilesInTmpDirectoryByDeep:(BOOL)deep;
-//遍历指定文件夹目录
-+ (NSArray *)listFilesInCoustomDirectoryByDeep:(NSString*)path deepBool:(BOOL)deep;
-
-#pragma mark - 获取文件属性
-// 根据key获取文件某个属性
-+ (id)attributeOfItemAtPath:(NSString *)path forKey:(NSString *)key;
-// 根据key获取文件某个属性(错误信息error)
-+ (id)attributeOfItemAtPath:(NSString *)path forKey:(NSString *)key error:(NSError **)error;
-// 获取文件属性集合
-+ (NSDictionary *)attributesOfItemAtPath:(NSString *)path;
-// 获取文件属性集合(错误信息error)
-+ (NSDictionary *)attributesOfItemAtPath:(NSString *)path error:(NSError **)error;
-
-#pragma mark - 创建文件(夹)
-// 创建文件夹
-+ (BOOL)createDirectoryAtPath:(NSString *)path;
-// 创建文件夹(错误信息error)
-+ (BOOL)createDirectoryAtPath:(NSString *)path error:(NSError **)error;
-// 创建文件
-+ (BOOL)createFileAtPath:(NSString *)path;
-// 创建文件(错误信息error)
-+ (BOOL)createFileAtPath:(NSString *)path error:(NSError **)error;
-// 创建文件,是否覆盖
-+ (BOOL)createFileAtPath:(NSString *)path overwrite:(BOOL)overwrite;
-// 创建文件,是否覆盖(错误信息error)
-+ (BOOL)createFileAtPath:(NSString *)path overwrite:(BOOL)overwrite error:(NSError **)error;
-// 创建文件,文件内容
-+ (BOOL)createFileAtPath:(NSString *)path content:(NSObject *)content;
-// 创建文件,文件内容(错误信息error)
-+ (BOOL)createFileAtPath:(NSString *)path content:(NSObject *)content error:(NSError **)error;
-// 创建文件,文件内容,是否覆盖
-+ (BOOL)createFileAtPath:(NSString *)path content:(NSObject *)content overwrite:(BOOL)overwrite;
-// 创建文件,文件内容,是否覆盖(错误信息error)
-+ (BOOL)createFileAtPath:(NSString *)path content:(NSObject *)content overwrite:(BOOL)overwrite error:(NSError **)error;
-// 获取创建文件时间
-+ (NSDate *)creationDateOfItemAtPath:(NSString *)path;
-// 获取创建文件时间(错误信息error)
-+ (NSDate *)creationDateOfItemAtPath:(NSString *)path error:(NSError **)error;
-// 获取文件修改时间
-+ (NSDate *)modificationDateOfItemAtPath:(NSString *)path;
-// 获取文件修改时间(错误信息error)
-+ (NSDate *)modificationDateOfItemAtPath:(NSString *)path error:(NSError **)error;
-
-#pragma mark - 删除文件(夹)
-// 删除文件
-+ (BOOL)removeItemAtPath:(NSString *)path;
-// 删除文件(错误信息error)
-+ (BOOL)removeItemAtPath:(NSString *)path error:(NSError **)error;
-// 清空Caches文件夹
-+ (BOOL)clearCachesDirectory;
-// 清空tmp文件夹
-+ (BOOL)clearTmpDirectory;
-
-#pragma mark - 复制文件(夹)
-// 复制文件
-+ (BOOL)copyItemAtPath:(NSString *)path toPath:(NSString *)toPath;
-// 复制文件(错误信息error)
-+ (BOOL)copyItemAtPath:(NSString *)path toPath:(NSString *)toPath error:(NSError **)error;
-// 复制文件,是否覆盖
-+ (BOOL)copyItemAtPath:(NSString *)path toPath:(NSString *)toPath overwrite:(BOOL)overwrite;
-// 复制文件,是否覆盖(错误信息error)
-+ (BOOL)copyItemAtPath:(NSString *)path toPath:(NSString *)toPath overwrite:(BOOL)overwrite error:(NSError **)error;
-
-#pragma mark - 移动文件(夹)
-// 移动文件
-+ (BOOL)moveItemAtPath:(NSString *)path toPath:(NSString *)toPath;
-// 移动文件(错误信息error)
-+ (BOOL)moveItemAtPath:(NSString *)path toPath:(NSString *)toPath error:(NSError **)error;
-// 移动文件,是否覆盖
-+ (BOOL)moveItemAtPath:(NSString *)path toPath:(NSString *)toPath overwrite:(BOOL)overwrite;
-// 移动文件,是否覆盖(错误信息error)
-+ (BOOL)moveItemAtPath:(NSString *)path toPath:(NSString *)toPath overwrite:(BOOL)overwrite error:(NSError **)error;
-
-#pragma mark - 根据URL获取文件名
-// 根据文件路径获取文件名称,是否需要后缀
-+ (NSString *)fileNameAtPath:(NSString *)path suffix:(BOOL)suffix;
-// 获取文件所在的文件夹路径
-+ (NSString *)directoryAtPath:(NSString *)path;
-// 根据文件路径获取文件扩展类型
-+ (NSString *)suffixAtPath:(NSString *)path;
-
-#pragma mark - 判断文件(夹)是否存在
-// 判断文件路径是否存在
-+ (BOOL)isExistsAtPath:(NSString *)path;
-// 判断路径是否为空(判空条件是文件大小为0,或者是文件夹下没有子文件)
-+ (BOOL)isEmptyItemAtPath:(NSString *)path;
-// 判断路径是否为空(错误信息error)
-+ (BOOL)isEmptyItemAtPath:(NSString *)path error:(NSError **)error;
-// 判断目录是否是文件夹
-+ (BOOL)isDirectoryAtPath:(NSString *)path;
-// 判断目录是否是文件夹(错误信息error)
-+ (BOOL)isDirectoryAtPath:(NSString *)path error:(NSError **)error;
-// 判断目录是否是文件
-+ (BOOL)isFileAtPath:(NSString *)path;
-// 判断目录是否是文件(错误信息error)
-+ (BOOL)isFileAtPath:(NSString *)path error:(NSError **)error;
-// 判断目录是否可以执行
-+ (BOOL)isExecutableItemAtPath:(NSString *)path;
-// 判断目录是否可读
-+ (BOOL)isReadableItemAtPath:(NSString *)path;
-// 判断目录是否可写
-+ (BOOL)isWritableItemAtPath:(NSString *)path;
-
-#pragma mark - 获取文件(夹)大小
-// 获取目录大小
-+ (NSNumber *)sizeOfItemAtPath:(NSString *)path;
-// 获取目录大小(错误信息error)
-+ (NSNumber *)sizeOfItemAtPath:(NSString *)path error:(NSError **)error;
-// 获取文件大小
-+ (NSNumber *)sizeOfFileAtPath:(NSString *)path;
-// 获取文件大小(错误信息error)
-+ (NSNumber *)sizeOfFileAtPath:(NSString *)path error:(NSError **)error;
-// 获取文件夹大小
-+ (NSNumber *)sizeOfDirectoryAtPath:(NSString *)path;
-// 获取文件夹大小(错误信息error)
-+ (NSNumber *)sizeOfDirectoryAtPath:(NSString *)path error:(NSError **)error;
-
-// 获取目录大小,返回格式化后的数值
-+ (NSString *)sizeFormattedOfItemAtPath:(NSString *)path;
-// 获取目录大小,返回格式化后的数值(错误信息error)
-+ (NSString *)sizeFormattedOfItemAtPath:(NSString *)path error:(NSError **)error;
-// 获取文件大小,返回格式化后的数值
-+ (NSString *)sizeFormattedOfFileAtPath:(NSString *)path;
-// 获取文件大小,返回格式化后的数值(错误信息error)
-+ (NSString *)sizeFormattedOfFileAtPath:(NSString *)path error:(NSError **)error;
-// 获取文件夹大小,返回格式化后的数值
-+ (NSString *)sizeFormattedOfDirectoryAtPath:(NSString *)path;
-// 获取文件夹大小,返回格式化后的数值(错误信息error)
-+ (NSString *)sizeFormattedOfDirectoryAtPath:(NSString *)path error:(NSError **)error;
-
-#pragma mark - 写入文件内容
-// 写入文件内容
-+ (BOOL)writeFileAtPath:(NSString *)path content:(NSObject *)content;
-// 写入文件内容(错误信息error)
-+ (BOOL)writeFileAtPath:(NSString *)path content:(NSObject *)content error:(NSError **)error;
-
-@end

+ 0 - 492
创维盒子/code/Vendor/UploadManager/CWUploadManage/CWFileManager.m

@@ -1,492 +0,0 @@
-//
-//  CWUploadTask.m
-//  uploadFileDemo
-//
-//  Created by hyjet on 2018/3/9.
-//  Copyright © 2018年 uploadFileDemo. All rights reserved.
-
-#import "CWFileManager.h"
-
-@interface CWFileManager ()
-
-@property (strong, nonatomic) NSFileManager *manager;
-
-@end
-
-
-@implementation CWFileManager
-
-#pragma mark - 沙盒目录相关
-+ (NSString *)homeDir {
-    return NSHomeDirectory();
-}
-
-+ (NSString *)documentsDir {
-    return [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject];
-}
-
-+ (NSString *)libraryDir {
-    return [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) lastObject];;
-}
-
-+ (NSString *)preferencesDir {
-    NSString *libraryDir = [self libraryDir];
-    return [libraryDir stringByAppendingPathComponent:@"Preferences"];
-}
-
-+ (NSString *)cachesDir {
-    return [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject];
-}
-
-+ (NSString *)tmpDir {
-    return NSTemporaryDirectory();
-}
-#pragma mark - 遍历文件夹
-+ (NSArray *)listFilesInDirectoryAtPath:(NSString *)path deep:(BOOL)deep {
-    NSArray *listArr;
-    NSError *error;
-    NSFileManager *manager = [NSFileManager defaultManager];
-    if (deep) {
-        // 深遍历
-        NSArray *deepArr = [manager subpathsOfDirectoryAtPath:path error:&error];
-        if (!error) {
-            listArr = deepArr;
-        }else {
-            listArr = nil;
-        }
-    }else {
-        // 浅遍历
-        NSArray *shallowArr = [manager contentsOfDirectoryAtPath:path error:&error];
-        if (!error) {
-            listArr = shallowArr;
-        }else {
-            listArr = nil;
-        }
-    }
-    return listArr;
-}
-
-+ (NSArray *)listFilesInHomeDirectoryByDeep:(BOOL)deep {
-    return [self listFilesInDirectoryAtPath:[self homeDir] deep:deep];
-}
-
-+ (NSArray *)listFilesInLibraryDirectoryByDeep:(BOOL)deep {
-    return [self listFilesInDirectoryAtPath:[self libraryDir] deep:deep];
-}
-
-+ (NSArray *)listFilesInDocumentDirectoryByDeep:(BOOL)deep {
-    return [self listFilesInDirectoryAtPath:[self documentsDir] deep:deep];
-}
-
-+ (NSArray *)listFilesInTmpDirectoryByDeep:(BOOL)deep {
-    return [self listFilesInDirectoryAtPath:[self tmpDir] deep:deep];
-}
-
-+ (NSArray *)listFilesInCachesDirectoryByDeep:(BOOL)deep {
-    return [self listFilesInDirectoryAtPath:[self cachesDir] deep:deep];
-}
-
-+ (NSArray *)listFilesInCoustomDirectoryByDeep:(NSString*)path deepBool:(BOOL)deep{
-    if (![CWFileManager isExistsAtPath:path]) {
-        return @[];
-    }
-    return [self listFilesInDirectoryAtPath:path deep:deep];
-}
-
-#pragma mark - 获取文件属性
-+ (id)attributeOfItemAtPath:(NSString *)path forKey:(NSString *)key {
-    return [[self attributesOfItemAtPath:path] objectForKey:key];
-}
-
-+ (id)attributeOfItemAtPath:(NSString *)path forKey:(NSString *)key error:(NSError *__autoreleasing *)error {
-    return [[self attributesOfItemAtPath:path error:error] objectForKey:key];
-}
-
-+ (NSDictionary *)attributesOfItemAtPath:(NSString *)path {
-    return [self attributesOfItemAtPath:path error:nil];
-}
-
-+ (NSDictionary *)attributesOfItemAtPath:(NSString *)path error:(NSError *__autoreleasing *)error {
-    return [[NSFileManager defaultManager] attributesOfItemAtPath:path error:error];
-}
-
-#pragma mark - 创建文件(夹)
-+ (BOOL)createDirectoryAtPath:(NSString *)path {
-    return [self createDirectoryAtPath:path error:nil];
-}
-
-+ (BOOL)createDirectoryAtPath:(NSString *)path error:(NSError *__autoreleasing *)error {
-    NSFileManager *manager = [NSFileManager defaultManager];
-    BOOL isSuccess = [manager createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil error:error];
-    return isSuccess;
-}
-
-+ (BOOL)createFileAtPath:(NSString *)path {
-    return [self createFileAtPath:path content:nil overwrite:YES error:nil];
-}
-
-+ (BOOL)createFileAtPath:(NSString *)path error:(NSError *__autoreleasing *)error {
-    return [self createFileAtPath:path content:nil overwrite:YES error:error];
-}
-
-+ (BOOL)createFileAtPath:(NSString *)path overwrite:(BOOL)overwrite {
-    return [self createFileAtPath:path content:nil overwrite:overwrite error:nil];
-}
-
-+ (BOOL)createFileAtPath:(NSString *)path overwrite:(BOOL)overwrite error:(NSError *__autoreleasing *)error {
-    return [self createFileAtPath:path content:nil overwrite:overwrite error:error];
-}
-
-+ (BOOL)createFileAtPath:(NSString *)path content:(NSObject *)content {
-    return [self createFileAtPath:path content:content overwrite:YES error:nil];
-}
-
-+ (BOOL)createFileAtPath:(NSString *)path content:(NSObject *)content error:(NSError *__autoreleasing *)error {
-    return [self createFileAtPath:path content:content overwrite:YES error:error];
-}
-
-+ (BOOL)createFileAtPath:(NSString *)path content:(NSObject *)content overwrite:(BOOL)overwrite {
-    return [self createFileAtPath:path content:content overwrite:overwrite error:nil];
-}
-
-+ (BOOL)createFileAtPath:(NSString *)path content:(NSObject *)content overwrite:(BOOL)overwrite error:(NSError *__autoreleasing *)error {
-    // 如果文件夹路径不存在,那么先创建文件夹
-    NSString *directoryPath = [self directoryAtPath:path];
-    if (![self isExistsAtPath:directoryPath]) {
-        // 创建文件夹
-        if (![self createDirectoryAtPath:directoryPath error:error]) {
-            return NO;
-        }
-    }
-    // 如果文件存在,并不想覆盖,那么直接返回YES。
-    if (!overwrite) {
-        if ([self isExistsAtPath:path]) {
-            return YES;
-        }
-    }
-    // 创建文件
-    BOOL isSuccess = [[NSFileManager defaultManager] createFileAtPath:path contents:nil attributes:nil];
-    if (content) {
-        [self writeFileAtPath:path content:content error:error];
-    }
-    return isSuccess;
-}
-
-+ (NSDate *)creationDateOfItemAtPath:(NSString *)path {
-    return [self creationDateOfItemAtPath:path error:nil];
-}
-
-+ (NSDate *)creationDateOfItemAtPath:(NSString *)path error:(NSError *__autoreleasing *)error {
-    return (NSDate *)[self attributeOfItemAtPath:path forKey:NSFileCreationDate error:error];
-}
-
-+ (NSDate *)modificationDateOfItemAtPath:(NSString *)path {
-    return [self modificationDateOfItemAtPath:path error:nil];
-}
-
-+ (NSDate *)modificationDateOfItemAtPath:(NSString *)path error:(NSError *__autoreleasing *)error {
-    return (NSDate *)[self attributeOfItemAtPath:path forKey:NSFileModificationDate error:error];
-}
-
-#pragma mark - 删除文件(夹)
-+ (BOOL)removeItemAtPath:(NSString *)path {
-    return [self removeItemAtPath:path error:nil];
-}
-
-+ (BOOL)removeItemAtPath:(NSString *)path error:(NSError *__autoreleasing *)error {
-    return [[NSFileManager defaultManager] removeItemAtPath:path error:error];
-}
-
-+ (BOOL)clearCachesDirectory {
-    NSArray *subFiles = [self listFilesInCachesDirectoryByDeep:NO];
-    BOOL isSuccess = YES;
-    
-    for (NSString *file in subFiles) {
-        NSString *absolutePath = [[self cachesDir] stringByAppendingPathComponent:file];
-        isSuccess &= [self removeItemAtPath:absolutePath];
-    }
-    return isSuccess;
-}
-
-+ (BOOL)clearTmpDirectory {
-    NSArray *subFiles = [self listFilesInTmpDirectoryByDeep:NO];
-    BOOL isSuccess = YES;
-    
-    for (NSString *file in subFiles) {
-        NSString *absolutePath = [[self tmpDir] stringByAppendingPathComponent:file];
-        isSuccess &= [self removeItemAtPath:absolutePath];
-    }
-    return isSuccess;
-}
-
-#pragma mark - 复制文件(夹)
-+ (BOOL)copyItemAtPath:(NSString *)path toPath:(NSString *)toPath {
-    return [self copyItemAtPath:path toPath:toPath overwrite:NO error:nil];
-}
-
-+ (BOOL)copyItemAtPath:(NSString *)path toPath:(NSString *)toPath error:(NSError *__autoreleasing *)error {
-    return [self copyItemAtPath:path toPath:toPath overwrite:NO error:error];
-}
-
-+ (BOOL)copyItemAtPath:(NSString *)path toPath:(NSString *)toPath overwrite:(BOOL)overwrite {
-    return [self copyItemAtPath:path toPath:toPath overwrite:overwrite error:nil];
-}
-
-+ (BOOL)copyItemAtPath:(NSString *)path toPath:(NSString *)toPath overwrite:(BOOL)overwrite error:(NSError *__autoreleasing *)error {
-    // 先要保证源文件路径存在,不然抛出异常
-    if (![self isExistsAtPath:path]) {
-        [NSException raise:@"非法的源文件路径" format:@"源文件路径%@不存在,请检查源文件路径", path];
-        return NO;
-    }
-    NSString *toDirPath = [self directoryAtPath:toPath];
-    if (![self isExistsAtPath:toDirPath]) {
-        // 创建复制路径
-        if (![self createDirectoryAtPath:toDirPath error:error]) {
-            return NO;
-        }
-    }
-    // 如果覆盖,那么先删掉原文件
-    if (overwrite) {
-        if ([self isExistsAtPath:toPath]) {
-            [self removeItemAtPath:toPath error:error];
-        }
-    }
-    // 复制文件
-    BOOL isSuccess = [[NSFileManager defaultManager] copyItemAtPath:path toPath:toPath error:error];
-    
-    return isSuccess;
-}
-
-#pragma mark - 移动文件(夹)
-+ (BOOL)moveItemAtPath:(NSString *)path toPath:(NSString *)toPath {
-    return [self moveItemAtPath:path toPath:toPath overwrite:NO error:nil];
-}
-
-+ (BOOL)moveItemAtPath:(NSString *)path toPath:(NSString *)toPath error:(NSError *__autoreleasing *)error {
-    return [self moveItemAtPath:path toPath:toPath overwrite:NO error:error];
-}
-
-+ (BOOL)moveItemAtPath:(NSString *)path toPath:(NSString *)toPath overwrite:(BOOL)overwrite {
-    return [self moveItemAtPath:path toPath:toPath overwrite:overwrite error:nil];
-}
-
-+ (BOOL)moveItemAtPath:(NSString *)path toPath:(NSString *)toPath overwrite:(BOOL)overwrite error:(NSError *__autoreleasing *)error {
-    // 先要保证源文件路径存在,不然抛出异常
-    if (![self isExistsAtPath:path]) {
-        [NSException raise:@"非法的源文件路径" format:@"源文件路径%@不存在,请检查源文件路径", path];
-        return NO;
-    }
-    NSString *toDirPath = [self directoryAtPath:toPath];
-    if (![self isExistsAtPath:toDirPath]) {
-        // 创建移动路径
-        if (![self createDirectoryAtPath:toDirPath error:error]) {
-            return NO;
-        }
-    }
-    // 如果覆盖,那么先删掉原文件
-    if ([self isExistsAtPath:toPath]) {
-        if (overwrite) {
-            [self removeItemAtPath:toPath error:error];
-        }else {
-            [self removeItemAtPath:path error:error];
-            return YES;
-        }
-    }
-    
-    // 移动文件 用copy复制 不要用move剪切
-    BOOL isSuccess = [[NSFileManager defaultManager] copyItemAtPath:path toPath:toPath error:error];
-    
-    return isSuccess;
-}
-
-#pragma mark - 根据URL获取文件名
-+ (NSString *)fileNameAtPath:(NSString *)path suffix:(BOOL)suffix {
-    NSString *fileName = [path lastPathComponent];
-    if (!suffix) {
-        fileName = [fileName stringByDeletingPathExtension];
-    }
-    return fileName;
-}
-
-+ (NSString *)directoryAtPath:(NSString *)path {
-    return [path stringByDeletingLastPathComponent];
-}
-
-+ (NSString *)suffixAtPath:(NSString *)path {
-    return [path pathExtension];
-}
-
-#pragma mark - 判断文件(夹)是否存在
-+ (BOOL)isExistsAtPath:(NSString *)path {
-    return [[NSFileManager defaultManager] fileExistsAtPath:path];
-}
-
-+ (BOOL)isEmptyItemAtPath:(NSString *)path {
-    return [self isEmptyItemAtPath:path error:nil];
-}
-
-+ (BOOL)isEmptyItemAtPath:(NSString *)path error:(NSError *__autoreleasing *)error {
-    return ([self isFileAtPath:path error:error] &&
-            [[self sizeOfItemAtPath:path error:error] intValue] == 0) ||
-    ([self isDirectoryAtPath:path error:error] &&
-     [[self listFilesInDirectoryAtPath:path deep:NO] count] == 0);
-}
-
-+ (BOOL)isDirectoryAtPath:(NSString *)path {
-    return [self isDirectoryAtPath:path error:nil];
-}
-
-+ (BOOL)isDirectoryAtPath:(NSString *)path error:(NSError *__autoreleasing *)error {
-    return ([self attributeOfItemAtPath:path forKey:NSFileType error:error] == NSFileTypeDirectory);
-}
-
-+ (BOOL)isFileAtPath:(NSString *)path {
-    return [self isFileAtPath:path error:nil];
-}
-
-+ (BOOL)isFileAtPath:(NSString *)path error:(NSError *__autoreleasing *)error {
-    return ([self attributeOfItemAtPath:path forKey:NSFileType error:error] == NSFileTypeRegular);
-}
-
-+ (BOOL)isExecutableItemAtPath:(NSString *)path {
-    return [[NSFileManager defaultManager] isExecutableFileAtPath:path];
-}
-
-+ (BOOL)isReadableItemAtPath:(NSString *)path {
-    return [[NSFileManager defaultManager] isReadableFileAtPath:path];
-}
-+ (BOOL)isWritableItemAtPath:(NSString *)path {
-    return [[NSFileManager defaultManager] isWritableFileAtPath:path];
-}
-
-#pragma mark - 获取文件(夹)大小
-+ (NSNumber *)sizeOfItemAtPath:(NSString *)path {
-    return [self sizeOfItemAtPath:path error:nil];
-}
-
-+ (NSNumber *)sizeOfItemAtPath:(NSString *)path error:(NSError *__autoreleasing *)error {
-    return (NSNumber *)[self attributeOfItemAtPath:path forKey:NSFileSize error:error];
-}
-
-+ (NSNumber *)sizeOfFileAtPath:(NSString *)path {
-    return [self sizeOfFileAtPath:path error:nil];
-}
-
-+ (NSNumber *)sizeOfFileAtPath:(NSString *)path error:(NSError *__autoreleasing *)error {
-    if ([self isFileAtPath:path error:error]) {
-        return [self sizeOfItemAtPath:path error:error];
-    }
-    return nil;
-}
-
-+ (NSNumber *)sizeOfDirectoryAtPath:(NSString *)path {
-    return [self sizeOfDirectoryAtPath:path error:nil];
-}
-
-+ (NSNumber *)sizeOfDirectoryAtPath:(NSString *)path error:(NSError *__autoreleasing *)error {
-    if ([self isDirectoryAtPath:path error:error]) {
-        NSArray *subPaths = [self listFilesInDirectoryAtPath:path deep:YES];
-        NSEnumerator *contentsEnumurator = [subPaths objectEnumerator];
-        
-        NSString *file;
-        unsigned long long int folderSize = 0;
-        
-        while (file = [contentsEnumurator nextObject]) {
-            NSDictionary *fileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:[path stringByAppendingPathComponent:file] error:nil];
-            folderSize += [[fileAttributes objectForKey:NSFileSize] intValue];
-        }
-        return [NSNumber numberWithUnsignedLongLong:folderSize];
-    }
-    return nil;
-}
-
-+ (NSString *)sizeFormattedOfItemAtPath:(NSString *)path {
-    return [self sizeFormattedOfItemAtPath:path error:nil];
-}
-
-+ (NSString *)sizeFormattedOfItemAtPath:(NSString *)path error:(NSError *__autoreleasing *)error {
-    NSNumber *size = [self sizeOfItemAtPath:path error:error];
-    if (size) {
-        return [self sizeFormatted:size];
-    }
-    return nil;
-}
-
-+ (NSString *)sizeFormattedOfFileAtPath:(NSString *)path {
-    return [self sizeFormattedOfFileAtPath:path error:nil];
-}
-
-+ (NSString *)sizeFormattedOfFileAtPath:(NSString *)path error:(NSError *__autoreleasing *)error {
-    NSNumber *size = [self sizeOfFileAtPath:path error:error];
-    if (size) {
-        return [self sizeFormatted:size];
-    }
-    return nil;
-}
-
-+ (NSString *)sizeFormattedOfDirectoryAtPath:(NSString *)path {
-    return [self sizeFormattedOfDirectoryAtPath:path error:nil];
-}
-
-+ (NSString *)sizeFormattedOfDirectoryAtPath:(NSString *)path error:(NSError *__autoreleasing *)error {
-    NSNumber *size = [self sizeOfDirectoryAtPath:path error:error];
-    if (size) {
-        return [self sizeFormatted:size];
-    }
-    return nil;
-}
-
-#pragma mark - 写入文件内容
-+ (BOOL)writeFileAtPath:(NSString *)path content:(NSObject *)content {
-    return [self writeFileAtPath:path content:content error:nil];
-}
-
-+ (BOOL)writeFileAtPath:(NSString *)path content:(NSObject *)content error:(NSError *__autoreleasing *)error {
-    if (!content) {
-        [NSException raise:@"非法的文件内容" format:@"文件内容不能为nil"];
-        return NO;
-    }
-    if ([self isExistsAtPath:path]) {
-        if ([content isKindOfClass:[NSMutableArray class]]) {
-            [(NSMutableArray *)content writeToFile:path atomically:YES];
-        }else if ([content isKindOfClass:[NSArray class]]) {
-            [(NSArray *)content writeToFile:path atomically:YES];
-        }else if ([content isKindOfClass:[NSMutableData class]]) {
-            [(NSMutableData *)content writeToFile:path atomically:YES];
-        }else if ([content isKindOfClass:[NSData class]]) {
-            [(NSData *)content writeToFile:path atomically:YES];
-        }else if ([content isKindOfClass:[NSMutableDictionary class]]) {
-            [(NSMutableDictionary *)content writeToFile:path atomically:YES];
-        }else if ([content isKindOfClass:[NSDictionary class]]) {
-            [(NSDictionary *)content writeToFile:path atomically:YES];
-        }else if ([content isKindOfClass:[NSJSONSerialization class]]) {
-            [(NSDictionary *)content writeToFile:path atomically:YES];
-        }else if ([content isKindOfClass:[NSMutableString class]]) {
-            [[((NSString *)content) dataUsingEncoding:NSUTF8StringEncoding] writeToFile:path atomically:YES];
-        }else if ([content isKindOfClass:[NSString class]]) {
-            [[((NSString *)content) dataUsingEncoding:NSUTF8StringEncoding] writeToFile:path atomically:YES];
-        }else if ([content isKindOfClass:[UIImage class]]) {
-            [UIImagePNGRepresentation((UIImage *)content) writeToFile:path atomically:YES];
-        }else if ([content conformsToProtocol:@protocol(NSCoding)]) {
-            [NSKeyedArchiver archiveRootObject:content toFile:path];
-        }else {
-            [NSException raise:@"非法的文件内容" format:@"文件类型%@异常,无法被处理。", NSStringFromClass([content class])];
-            
-            return NO;
-        }
-    }else {
-        return NO;
-    }
-    return YES;
-}
-
-#pragma mark - private methods
-+ (BOOL)isNotError:(NSError **)error {
-    return ((error == nil) || ((*error) == nil));
-}
-
-+(NSString *)sizeFormatted:(NSNumber *)size {
-    return [NSByteCountFormatter stringFromByteCount:[size unsignedLongLongValue] countStyle:NSByteCountFormatterCountStyleFile];
-}
-
-@end

+ 0 - 90
创维盒子/code/Vendor/UploadManager/CWUploadManage/CWFileStreamSeparation.h

@@ -1,90 +0,0 @@
-//
-//  CWFileStreamSeparation.h
-//  uploadFileDemo
-//
-//  Created by hyjet on 2018/3/9.
-//  Copyright © 2018年 uploadFileDemo. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-
-typedef enum : NSUInteger {
-    CWUploadStatusWaiting = 0,//任务队列等待
-    CWUploadStatusUpdownloading,//上传中
-    CWUploadStatusPaused,//暂停
-    CWUploadStatusFinished,//上传成功
-    CWUploadStatusFailed //上传失败
-} CWUploadStatus;//任务状态
-
-#define CWStreamFragmentMaxSize         1024 * 1024 // 500KB
-
-
-@class CWStreamFragment;
-
-/**
- * 文件流操作类
- */
-@interface CWFileStreamSeparation : NSObject<NSCoding>
-@property (nonatomic, copy) NSString    *fileName;//包括文件后缀名的文件名
-@property (nonatomic, strong)  NSData   *imageData; //文件预览图
-@property (nonatomic, assign)  NSInteger timeStamp;    //时间戳
-@property (nonatomic, assign) NSUInteger fileSize;//文件大小
-@property (nonatomic, copy) NSString *filePath;;//文件所在的文件目录
-@property (nonatomic, copy) NSString *uploadLocation;;//上传到服务器的文件目录
-@property (nonatomic, assign)CWUploadStatus fileStatus;//文件状态
-@property (nonatomic, copy)NSString *md5String;//文件md5编码名称
-@property (nonatomic, strong) NSArray<CWStreamFragment*> *streamFragments;//文件分片数组
-@property (nonatomic, copy) NSString *bizId;
-
-@property (nonatomic,assign)double progressRate;//上传进度
-@property (nonatomic,assign)NSInteger uploadDateSize;//已上传文件大小
-
-@property (nonatomic,assign)NSInteger select;  // 是否被选中
-
-
-/** description */
-@property (readonly, copy) NSString *description;
-
-//若为读取文件数据,打开一个已存在的文件。
-//若为写入文件数据,如果文件不存在,会创建的新的空文件。(创建FileStreamer对象就可以直接使用fragments(分片数组)属性)
-- (instancetype)initFileOperationAtPath:(NSString*)path forReadOperation:(BOOL)isReadOperation;
-
-- (instancetype)initFileOperationAtPath:(NSString*)path forReadOperation:(BOOL)isReadOperation uploadLocation:(NSString *)uploadLocation imageData:(NSData *)imageData;
-
-//获取当前偏移量
-- (NSUInteger)offsetInFile;
-
-//设置偏移量, 仅对读取设置
-- (void)seekToFileOffset:(NSUInteger)offset;
-
-//将偏移量定位到文件的末尾
-- (NSUInteger)seekToEndOfFile;
-
-//关闭文件
-- (void)closeFile;
-
-#pragma mark - 读操作
-//通过分片信息读取对应的片数据
-- (NSData*)readDateOfFragment:(CWStreamFragment*)fragment;
-
-//从当前文件偏移量开始
-- (NSData*)readDataOfLength:(NSUInteger)bytes;
-
-//从当前文件偏移量开始
-- (NSData*)readDataToEndOfFile;
-
-#pragma mark - 写操作
-//写入文件数据
-- (void)writeData:(NSData *)data;
-
-+(NSString*)fileKeyMD5WithPath:(NSString*)path;
-
-@end
-
-//上传文件片
-@interface CWStreamFragment : NSObject<NSCoding>
-@property (nonatomic,copy)NSString          *fragmentId;    //片的唯一标识
-@property (nonatomic,assign)NSUInteger      fragmentSize;   //片的大小
-@property (nonatomic,assign)NSUInteger      fragementOffset;//片的偏移量
-@property (nonatomic,assign)BOOL            fragmentStatus; //上传状态 YES上传成功
-@end

+ 0 - 451
创维盒子/code/Vendor/UploadManager/CWUploadManage/CWFileStreamSeparation.m

@@ -1,451 +0,0 @@
-//
-//  CWFileStreamSeparation.m
-//  uploadFileDemo
-//
-//  Created by hyjet on 2018/3/9.
-//  Copyright © 2018年 uploadFileDemo. All rights reserved.
-//
-
-#import "CWFileStreamSeparation.h"
-#import "CWFileManager.h"
-#import <CommonCrypto/CommonDigest.h>
-#import "objc/runtime.h"
-
-#pragma mark - CWFileStreamSeparation
-#define FileHashDefaultChunkSizeForReadingData 1024*8
-
-@interface CWFileStreamSeparation ()
-//@property (nonatomic, copy) NSString                          *fileName;
-//@property (nonatomic, assign) NSUInteger                      fileSize;
-//@property (nonatomic, strong) NSArray<CWStreamFragment*>      *streamFragments;
-@property (nonatomic, strong) NSFileHandle                    *readFileHandle;
-@property (nonatomic, strong) NSFileHandle                    *writeFileHandle;
-@property (nonatomic, assign) BOOL                            isReadOperation;
-//@property (nonatomic,assign)double progressRate;
-//@property (nonatomic,assign)NSInteger uploadDateSize;
-@end
-
-@implementation CWFileStreamSeparation
-
--(NSString *)description{
-    unsigned int count;
-    const char *clasName = object_getClassName(self);
-    NSMutableString *string = [NSMutableString stringWithFormat:@"<%s: %p>:[ \n",clasName, self];
-    Class clas = NSClassFromString([NSString stringWithCString:clasName encoding:NSUTF8StringEncoding]);
-    Ivar *ivars = class_copyIvarList(clas, &count);
-    for (int i = 0; i < count; i++) {
-        @autoreleasepool {
-            Ivar ivar = ivars[i];
-            const char *name = ivar_getName(ivar);
-            //得到类型
-            NSString *type = [NSString stringWithCString:ivar_getTypeEncoding(ivar) encoding:NSUTF8StringEncoding];
-            NSString *key = [NSString stringWithCString:name encoding:NSUTF8StringEncoding];
-            id value = [self valueForKey:key];
-            //确保BOOL 值输出的是YES 或 NO,这里的B是我打印属性类型得到的……
-            if ([type isEqualToString:@"B"]) {
-                value = (value == 0 ? @"NO" : @"YES");
-            }
-            [string appendFormat:@"\t%@: %@\n",[self delLine:key], value];
-        }
-    }
-    [string appendFormat:@"]"];
-    return string;
-}
-//因为ivar_getName得到的是一个带有下划线的名字,去掉下划线看起来更漂亮
--(NSString *)delLine:(NSString *)string{
-    if ([string hasPrefix:@"_"]) {
-        return [string substringFromIndex:1];
-    }
-    return string;
-}
-
-+ (NSString *)fileKey {
-    
-    CFUUIDRef uuid = CFUUIDCreate(kCFAllocatorDefault);
-    CFStringRef cfstring = CFUUIDCreateString(kCFAllocatorDefault, uuid);
-    const char *cStr = CFStringGetCStringPtr(cfstring,CFStringGetFastestEncoding(cfstring));
-    unsigned char result[16];
-    CC_MD5( cStr, (unsigned int)strlen(cStr), result );
-    CFRelease(uuid);
-    CFRelease(cfstring);
-    
-    return [NSString stringWithFormat:
-            @"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%08lx",
-            result[0], result[1], result[2], result[3],
-            result[4], result[5], result[6], result[7],
-            result[8], result[9], result[10], result[11],
-            result[12], result[13], result[14], result[15],
-            (unsigned long)(arc4random() % NSUIntegerMax)];
-}
-
-+ (NSString *)fileKeyMD5WithPath:(NSString*)path
-{
-    return (__bridge_transfer NSString *)FileMD5HashCreateWithPath((__bridge CFStringRef)path, FileHashDefaultChunkSizeForReadingData);
-//    NSString *fileName = [path lastPathComponent];
-//    return [RSATool md5Encrypt:fileName];
-}
-
-CFStringRef FileMD5HashCreateWithPath(CFStringRef filePath,size_t chunkSizeForReadingData) {
-    // Declare needed variables
-    CFStringRef result = NULL;
-    CFReadStreamRef readStream = NULL;
-    // Get the file URL
-    CFURLRef fileURL =
-    CFURLCreateWithFileSystemPath(kCFAllocatorDefault,
-                                  (CFStringRef)filePath,
-                                  kCFURLPOSIXPathStyle,
-                                  (Boolean)false);
-    if (!fileURL) goto done;
-    // Create and open the read stream
-    readStream = CFReadStreamCreateWithFile(kCFAllocatorDefault,
-                                            (CFURLRef)fileURL);
-    if (!readStream) goto done;
-    bool didSucceed = (bool)CFReadStreamOpen(readStream);
-    if (!didSucceed) goto done;
-    // Initialize the hash object
-    CC_MD5_CTX hashObject;
-    CC_MD5_Init(&hashObject);
-    // Make sure chunkSizeForReadingData is valid
-    if (!chunkSizeForReadingData) {
-        chunkSizeForReadingData = FileHashDefaultChunkSizeForReadingData;
-    }
-    // Feed the data to the hash object
-    bool hasMoreData = true;
-    while (hasMoreData) {
-        uint8_t buffer[chunkSizeForReadingData];
-        CFIndex readBytesCount = CFReadStreamRead(readStream,(UInt8 *)buffer,(CFIndex)sizeof(buffer));
-        if (readBytesCount == -1) break;
-        if (readBytesCount == 0) {
-            hasMoreData = false;
-            continue;
-        }
-        CC_MD5_Update(&hashObject,(const void *)buffer,(CC_LONG)readBytesCount);
-    }
-    // Check if the read operation succeeded
-    didSucceed = !hasMoreData;
-    // Compute the hash digest
-    unsigned char digest[CC_MD5_DIGEST_LENGTH];
-    CC_MD5_Final(digest, &hashObject);
-    // Abort if the read operation failed
-    if (!didSucceed) goto done;
-    // Compute the string result
-    char hash[2 * sizeof(digest) + 1];
-    for (size_t i = 0; i < sizeof(digest); ++i) {
-        snprintf(hash + (2 * i), 3, "%02x", (int)(digest[i]));
-    }
-    result = CFStringCreateWithCString(kCFAllocatorDefault,(const char *)hash,kCFStringEncodingUTF8);
-    
-done:
-    if (readStream) {
-        CFReadStreamClose(readStream);
-        CFRelease(readStream);
-    }
-    if (fileURL) {
-        CFRelease(fileURL);
-    }
-    return result;
-}
-
-
-- (void)encodeWithCoder:(NSCoder *)aCoder {
-    
-    [aCoder encodeObject:[self fileName] forKey:@"fileName"];
-    [aCoder encodeObject:[self imageData] forKey:@"imageData"];
-    [aCoder encodeObject:[NSNumber numberWithDouble:[self timeStamp]] forKey:@"timeStamp"];
-    [aCoder encodeObject:[self uploadLocation] forKey:@"uploadLocation"];
-    [aCoder encodeObject:[NSNumber numberWithUnsignedInteger:[self fileSize]] forKey:@"fileSize"];
-    [aCoder encodeObject:[NSNumber numberWithInteger:[self fileStatus]] forKey:@"fileStatus"];
-    [aCoder encodeObject:[self filePath] forKey:@"filePath"];
-    [aCoder encodeObject:[self md5String] forKey:@"md5String"];
-    [aCoder encodeObject:[self streamFragments] forKey:@"streamFragments"];
-    [aCoder encodeObject:[self bizId] forKey:@"bizId"];
-    [aCoder encodeObject:[NSNumber numberWithUnsignedInteger:[self uploadDateSize]] forKey:@"uploadDateSize"];
-    [aCoder encodeObject:[NSNumber numberWithDouble:[self progressRate]] forKey:@"progressRate"];
-}
-
-- (nullable instancetype)initWithCoder:(NSCoder *)aDecoder {
-    self = [super init];
-    if (self != nil) {
-        [self setFileName:[aDecoder decodeObjectForKey:@"fileName"]];
-        [self setImageData:[aDecoder decodeObjectForKey:@"imageData"]];
-        [self setTimeStamp:[[aDecoder decodeObjectForKey:@"timeStamp"] integerValue]];
-        [self setUploadLocation:[aDecoder decodeObjectForKey:@"uploadLocation"]];
-        [self setFileStatus:[[aDecoder decodeObjectForKey:@"fileStatus"] intValue]];
-        [self setFileSize:[[aDecoder decodeObjectForKey:@"fileSize"] unsignedIntegerValue]];
-        [self setFilePath:[aDecoder decodeObjectForKey:@"filePath"]];
-        [self setMd5String:[aDecoder decodeObjectForKey:@"md5String"]];
-        [self setStreamFragments:[aDecoder decodeObjectForKey:@"streamFragments"]];
-        [self setBizId:[aDecoder decodeObjectForKey:@"bizId"]];
-        [self setProgressRate:[[aDecoder decodeObjectForKey:@"progressRate"] doubleValue]];
-        [self setUploadDateSize:[[aDecoder decodeObjectForKey:@"uploadDateSize"] unsignedIntegerValue]];
-    }
-    
-    return self;
-}
-
-- (BOOL)getFileInfoAtPath:(NSString*)path {
-    
-    NSFileManager *fileMgr = [NSFileManager defaultManager];
-    if (![fileMgr fileExistsAtPath:path]) {
-        HLog(@"文件不存在:%@",path);
-        return NO;
-    }
-    
-    self.filePath = path;
-    
-    NSDictionary *attr =[fileMgr attributesOfItemAtPath:path error:nil];
-    self.fileSize = attr.fileSize;
-    
-    self.md5String = [CWFileStreamSeparation fileKeyMD5WithPath:path];
-    
-    self.bizId=[[NSUUID UUID] UUIDString];
-    
-    self.uploadDateSize = 0;
-    self.progressRate = 0.00;
-
-    NSString *fileName = [path lastPathComponent];
-    self.fileName = fileName;
-    
-    self.fileStatus = CWUploadStatusWaiting;
-    
-    return YES;
-}
-
-- (BOOL)getFileInfoAtPath:(NSString*)path uploadLocation:(NSString *)uploadLocation imageData:(NSData *)imageData {
-    
-    NSFileManager *fileMgr = [NSFileManager defaultManager];
-    if (![fileMgr fileExistsAtPath:path]) {
-        HLog(@"文件不存在:%@",path);
-        return NO;
-    }
-    
-    self.filePath = path;
-    
-    self.uploadLocation = uploadLocation;
-    self.imageData = imageData;
-    self.timeStamp = [[NSDate date] timeIntervalSince1970];
-    
-    NSDictionary *attr =[fileMgr attributesOfItemAtPath:path error:nil];
-    self.fileSize = attr.fileSize;
-    
-    self.md5String = [CWFileStreamSeparation fileKeyMD5WithPath:path];
-    
-    self.bizId=[[NSUUID UUID] UUIDString];
-    
-    self.uploadDateSize = 0;
-    self.progressRate = 0.00;
-
-    NSString *fileName = [path lastPathComponent];
-    self.fileName = fileName;
-    
-    self.fileStatus = CWUploadStatusWaiting;
-    
-    return YES;
-}
-
-
-// 若为读取文件数据,打开一个已存在的文件。
-// 若为写入文件数据,如果文件不存在,会创建的新的空文件。
-- (instancetype)initFileOperationAtPath:(NSString*)path forReadOperation:(BOOL)isReadOperation {
-    
-    if (self = [super init]) {
-        self.isReadOperation = isReadOperation;
-        if (_isReadOperation) {
-            if (![self getFileInfoAtPath:path]) {
-                return nil;
-            }
-            self.readFileHandle = [NSFileHandle fileHandleForReadingAtPath:path];
-            [self cutFileForFragments];
-        } else {
-            NSFileManager *fileMgr = [NSFileManager defaultManager];
-            if (![fileMgr fileExistsAtPath:path]) {
-                [fileMgr createFileAtPath:path contents:nil attributes:nil];
-            }
-            
-            if (![self getFileInfoAtPath:path]) {
-                return nil;
-            }
-            
-            self.writeFileHandle = [NSFileHandle fileHandleForWritingAtPath:path];
-        }
-    }
-    
-    return self;
-}
-
-// 若为读取文件数据,打开一个已存在的文件。
-// 若为写入文件数据,如果文件不存在,会创建的新的空文件。
-- (instancetype)initFileOperationAtPath:(NSString*)path forReadOperation:(BOOL)isReadOperation uploadLocation:(NSString *)uploadLocation imageData:(NSData *)imageData {
-    
-    if (self = [super init]) {
-        self.isReadOperation = isReadOperation;
-        if (_isReadOperation) {
-            if (![self getFileInfoAtPath:path uploadLocation:uploadLocation imageData:imageData]) {
-                return nil;
-            }
-            self.readFileHandle = [NSFileHandle fileHandleForReadingAtPath:path];
-            [self cutFileForFragments];
-        } else {
-            NSFileManager *fileMgr = [NSFileManager defaultManager];
-            if (![fileMgr fileExistsAtPath:path]) {
-                [fileMgr createFileAtPath:path contents:nil attributes:nil];
-            }
-            
-            if (![self getFileInfoAtPath:path uploadLocation:uploadLocation imageData:imageData]) {
-                return nil;
-            }
-            
-            self.writeFileHandle = [NSFileHandle fileHandleForWritingAtPath:path];
-        }
-    }
-    
-    return self;
-}
-
-#pragma mark - 读操作
-//切分文件片段
-- (void)cutFileForFragments {
-    
-    NSUInteger offset = CWStreamFragmentMaxSize;
-    // 块数
-    NSUInteger chunks = (_fileSize%offset==0)?(_fileSize/offset):(_fileSize/(offset) + 1);
-    
-    NSMutableArray<CWStreamFragment *> *fragments = [[NSMutableArray alloc] initWithCapacity:0];
-    for (NSUInteger i = 0; i < chunks; i ++) {
-        
-        CWStreamFragment *fFragment = [[CWStreamFragment alloc] init];
-        fFragment.fragmentStatus = NO;
-        fFragment.fragmentId = [[self class] fileKey];
-        fFragment.fragementOffset = i * offset;
-        
-        if (i != chunks - 1) {
-            fFragment.fragmentSize = offset;
-        } else {
-            fFragment.fragmentSize = _fileSize - fFragment.fragementOffset;
-        }
-        
-        [fragments addObject:fFragment];
-    }
-    
-    self.streamFragments = fragments;
-}
-
-//通过分片信息读取对应的片数据
-- (NSData*)readDateOfFragment:(CWStreamFragment*)fragment {
-    HLog(@"del 2024525  暂未做");
-    /* hxd del 2024525  暂未做
-    if (self.readFileHandle==nil) {
-        
-        NSDictionary *loginDict = [[UseAccountManage shareInstance] getLoginInfo];
-        if ([[loginDict allKeys] containsObject:@"account"])
-         {
-             NSString *fileFolder = kPath_YunPan_Upload_Folder;
-             NSString *fileName = [_filePath lastPathComponent];
-             NSString *fileURL = [fileFolder stringByAppendingPathComponent:fileName];
-             self.readFileHandle = [NSFileHandle fileHandleForReadingAtPath:fileURL];
-         }else {
-             HLog(@"未登录 读取缓存文件失败!");
-         }
-    }
-
-    if (fragment) {
-        [self seekToFileOffset:fragment.fragementOffset];
-        return [_readFileHandle readDataOfLength:fragment.fragmentSize];
-    }
-    [self closeFile];
-     */
-    return nil;
-}
-
-- (NSData*)readDataOfLength:(NSUInteger)bytes {
-    return [_readFileHandle readDataOfLength:bytes];
-}
-
-
-- (NSData*)readDataToEndOfFile {
-    return [_readFileHandle readDataToEndOfFile];
-}
-
-#pragma mark - 写操作
-
-// 写入文件数据
-- (void)writeData:(NSData *)data {
-    [_writeFileHandle writeData:data];
-}
-
-#pragma mark - common
-// 获取当前偏移量
-- (NSUInteger)offsetInFile{
-    if (_isReadOperation) {
-        return [_readFileHandle offsetInFile];
-    }
-    
-    return [_writeFileHandle offsetInFile];
-}
-
-// 设置偏移量,仅对读取设置
-- (void)seekToFileOffset:(NSUInteger)offset {
-    [_readFileHandle seekToFileOffset:offset];
-}
-
-// 将偏移量定位到文件的末尾
-- (NSUInteger)seekToEndOfFile{
-    if (_isReadOperation) {
-        return (NSUInteger)[_readFileHandle seekToEndOfFile];
-    }
-    
-    return [_writeFileHandle seekToEndOfFile];
-}
-
-// 关闭文件
-- (void)closeFile {
-    if (_isReadOperation) {
-        [_readFileHandle closeFile];
-    } else {
-        [_writeFileHandle closeFile];
-    }
-}
-
-//归档
-+ (void)archerTheDictionary:(NSDictionary *)dict file:(NSString *)path{
-    
-    NSData *data = [NSKeyedArchiver archivedDataWithRootObject:dict];
-    BOOL finish = [data writeToFile:path atomically:YES];
-    if (finish) HLog(@"归档成功");
-    
-}
-
-//解档
-+ (NSMutableDictionary *)unArcherThePlist:(NSString *)path{
-    NSMutableDictionary *dic = [NSKeyedUnarchiver unarchiveObjectWithFile:path];
-    return dic;
-}
-
-@end
-
-
-
-
-@implementation CWStreamFragment
-
-- (void)encodeWithCoder:(NSCoder *)aCoder {
-    
-    [aCoder encodeObject:[self fragmentId] forKey:@"fragmentId"];
-    [aCoder encodeObject:[NSNumber numberWithUnsignedInteger:[self fragmentSize]] forKey:@"fragmentSize"];
-    [aCoder encodeObject:[NSNumber numberWithUnsignedInteger:[self fragementOffset]] forKey:@"fragementOffset"];
-    [aCoder encodeObject:[NSNumber numberWithUnsignedInteger:[self fragmentStatus]] forKey:@"fragmentStatus"];
-}
-
-- (nullable instancetype)initWithCoder:(NSCoder *)aDecoder {
-    self = [super init];
-    if (self != nil) {
-        [self setFragmentId:[aDecoder decodeObjectForKey:@"fragmentId"]];
-        [self setFragmentSize:[[aDecoder decodeObjectForKey:@"fragmentSize"] unsignedIntegerValue]];
-        [self setFragementOffset:[[aDecoder decodeObjectForKey:@"fragementOffset"] unsignedIntegerValue]];
-        [self setFragmentStatus:[[aDecoder decodeObjectForKey:@"fragmentStatus"] boolValue]];
-    }
-    
-    return self;
-}
-
-@end

+ 0 - 114
创维盒子/code/Vendor/UploadManager/CWUploadManage/CWFileUploadManager.h

@@ -1,114 +0,0 @@
-//
-//  CWFileUploadManager.h
-//  uploadFileDemo
-//
-//  Created by hyjet on 2018/3/9.
-//  Copyright © 2018年 uploadFileDemo. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-#import "CWFileStreamSeparation.h"
-#import "CWUploadTask.h"
-#import "CWFileManager.h"
-#import "CWUploadTask+CheckInfo.h"
-
-/** 删除/清空上传任务通知 */
-#define CWUploadTaskExeDelete          @"CWUploadTaskExeDelete"
-
-@interface CWFileUploadManager : NSObject
-//总的文件分片模型数
-@property (nonatomic,readonly)NSMutableDictionary *fileStreamDict;
-
-//总任务数
-@property (nonatomic,readonly)NSMutableDictionary *allTasks;
-
-//正在上传中的任务
-@property (nonatomic,readonly)NSMutableDictionary *uploadingTasks;
-
-//正在等待上传的任务
-@property (nonatomic,readonly)NSMutableDictionary *uploadWaitTasks;
-
-//已经上传完的任务
-@property (nonatomic,readonly)NSMutableDictionary *uploadEndTasks;
-
-//同时上传的任务数
-@property (nonatomic,readonly)NSInteger uploadMaxNum;
-
-//云盘剩余空间
-@property (nonatomic,assign) int64_t leftStore;
-
-//配置的上传路径
-@property (nonatomic,readonly)NSURL *url;
-
-//配置的请求体
-@property (nonatomic,readonly)NSMutableURLRequest *request;
-
-//操作记录plist文件保存路径
-@property (nonatomic,copy)NSString *plistPath;
-
-//获得管理类单例对象
-+ (instancetype)shardUploadManager;
-
-//配置全局默认参数
-/**
- @param request 默认请求头
- @param num 最大任务数
- */
-- (void)config:(NSMutableURLRequest * _Nonnull)request maxTask:(NSInteger)num;
-
-//根据文件路径创建上传任务
-- (CWUploadTask *_Nullable)createUploadTask:(NSString *_Nonnull)filePath;
-
-//根据文件路径 服务器路径创建上传任务
-- (CWUploadTask *_Nullable)createUploadTask:(NSString *_Nonnull)filePath uploadLocation:(NSString *_Nonnull)uploadLocation imageData:(NSData *_Nullable)imageData;
-
-//云手机上传 写入plist文件
-- (void)createUploadTaskWithParams:(NSDictionary *)params;
-
-/**
- 暂停一个上传任务
- 
- @param fileStream 上传文件的路径
- */
-- (void)pauseUploadTask:(CWFileStreamSeparation *_Nonnull)fileStream;
-
-/**
- 继续开始一个上传任务
- 
- @param fileStream 上传文件的路径
- */
-- (void)resumeUploadTask:(CWFileStreamSeparation *_Nonnull)fileStream;
-
-/**
- 删除一个上传任务,同时会删除当前任务上传的缓存数据
- 
- @param fileStream 上传文件的路径
- */
-- (void)removeUploadTask:(CWFileStreamSeparation *_Nonnull)fileStream;
-
-/**
- 暂停所有上传任务
- */
-- (void)pauseAllUploadTask;
-
-/**
- 启动所有上传任务
- */
-- (void)resumeAllUploadTask;
-
-/**
- 删除所有上传任务
- */
-- (void)removeAllUploadTask;
-
-#pragma mark - 相册文件写入Cache
-/// 将相册里的视频文件缓存到Cache
-- (NSString *_Nullable)writeVideoDataFromURL:(NSURL *_Nullable)url uploadLocation:(NSString *_Nullable)uploadLocation;
-
-/// 将相册里的图片文件缓存到Cache
-- (NSString *_Nullable)writeIamgeData:(NSData *_Nullable)data iamgeName:(NSString *_Nullable)iamgeName uploadLocation:(NSString *_Nullable)uploadLocation;
-
-- (NSString *_Nullable)writeIamgeDataToLocal:(NSData *_Nullable)data;
-
-@end
-

+ 0 - 572
创维盒子/code/Vendor/UploadManager/CWUploadManage/CWFileUploadManager.m

@@ -1,572 +0,0 @@
-//
-//  CWFileUploadManager.m
-//  uploadFileDemo
-//
-//  Created by hyjet on 2018/3/9.
-//  Copyright © 2018年 uploadFileDemo. All rights reserved.
-//
-
-#import "CWFileUploadManager.h"
-//#import "CWFileStreamSeparation.h"
-//#import "CWUploadTask.h"
-//#import "CWFileManager.h"
-
-//#define plistPath [[CWFileManager cachesDir] stringByAppendingPathComponent:uploadPlist]
-#define default_max @"uploadMax"
-
-@interface CWFileUploadManager ()
-
-@property (nonatomic,strong)NSMutableDictionary *fileStreamDict;
-
-@property (nonatomic,strong)NSMutableDictionary *allTasks;
-
-//正在上传中的任务
-@property (nonatomic,strong)NSMutableDictionary *uploadingTasks;
-
-//正在等待上传的任务
-@property (nonatomic,strong)NSMutableDictionary *uploadWaitTasks;
-
-//已经上传完的任务
-@property (nonatomic,strong)NSMutableDictionary *uploadEndTasks;
-
-@property (nonatomic,assign)NSInteger uploadMaxNum;
-
-@property (nonatomic,strong)NSURL *url;
-@property (nonatomic,strong)NSMutableURLRequest *request;
-
-@property (nonatomic,copy)NSString *uploadLocation;
-
-@end
-
-@implementation CWFileUploadManager
-
-static CWFileUploadManager * _instance;
-
-- (NSString *)getNewPlistPath {
-
-    NSString *account = [HWDataManager getStringWithKey:Const_HWAccountPhoneNumber];
-    if (account.length != 0) {
-         NSString *fileFolder = kPath_YunPan_Upload_Folder;
-         return [fileFolder stringByAppendingPathComponent:@"uploadPlist.plist"];
-     }else {
-         HLog(@"未登录 读取plist缓存文件失败!");
-         return @"";
-     }
-}
-
--(NSMutableDictionary *)fileStreamDict{
-    if (!_fileStreamDict) {
-        _fileStreamDict = [NSMutableDictionary dictionary];
-    }
-    return _fileStreamDict;
-}
-
-- (NSMutableDictionary *)allTasks
-{
-    if (!_allTasks) {
-        _allTasks = [_instance allUploadTasks];
-    }
-    return _allTasks;
-}
-
-- (NSMutableDictionary *)uploadingTasks
-{
-    return [self allUploadingTasks];
-}
-
-- (NSMutableDictionary *)uploadWaitTasks
-{
-    return [self allUploadWaitTasks];
-}
-
-- (NSMutableDictionary *)uploadEndTasks
-{
-    return [self allUploadEndTasks];
-}
-
-+ (instancetype)shardUploadManager {
-    static dispatch_once_t onceToken;
-    dispatch_once(&onceToken, ^{
-        _instance = [[self alloc] init];
-        [_instance registeNotification];
-        [_instance defaultsTask];
-        _instance.plistPath = [_instance getNewPlistPath];
-    });
-    return _instance;
-}
-
-+ (CWUploadTask *)startUploadWithPath:(NSString *)path
-{
-    //是否是在册任务
-    if (![CWFileUploadManager isUploadTask:path]) {
-        [_instance taskRecord:path];
-        
-    }
-    return [_instance continuePerformTaskWithFilePath:path];
-}
-
-- (CWUploadTask *_Nullable)createUploadTask:(NSString *_Nonnull)filePath
-{
-    //是否是在册任务
-    if (![CWFileUploadManager isUploadTask:filePath]) {
-        [_instance taskRecord:filePath];
-        
-    }
-    return [self continuePerformTaskWithFilePath:filePath];
-}
-
-- (CWUploadTask *_Nullable)createUploadTask:(NSString *_Nonnull)filePath uploadLocation:(NSString *_Nonnull)uploadLocation imageData:(NSData *_Nullable)imageData {
-    
-    //是否是在册任务
-    if (![CWFileUploadManager isUploadTask:filePath]) {
-        [_instance taskRecord:filePath uploadLocation:uploadLocation imageData:imageData];
-        
-    }
-    return [self continuePerformTaskWithFilePath:filePath];
-}
-
-//云手机上传 写入plist文件
-- (void)createUploadTaskWithParams:(NSDictionary *)params {
-    
-    CWFileStreamSeparation *fileStream = [[CWFileStreamSeparation alloc] init];
-    NSString *path = [NSString stringWithFormat:@"%@", [params objectForKey:@"path"]];
-    fileStream.fileName = path.lastPathComponent;
-    fileStream.fileSize = [[params objectForKey:@"length"] integerValue];
-    fileStream.uploadDateSize = [[params objectForKey:@"length"] integerValue];
-    fileStream.progressRate = 1.00;
-    fileStream.bizId=[[NSUUID UUID] UUIDString];
-    fileStream.timeStamp = [iTools getNowTimeStamp];
-    fileStream.fileStatus = CWUploadStatusFinished;
-    
-    [self.fileStreamDict setObject:fileStream forKey:path.lastPathComponent];
-    CWUploadTask *uploadTask = self.allTasks[path.lastPathComponent];
-    if (!uploadTask) {
-        uploadTask = [CWUploadTask initWithStreamModel:fileStream];
-        [self.allTasks setObject:uploadTask forKey:path.lastPathComponent];
-    }
-    
-    [self archerTheDictionary:_fileStreamDict file:self.plistPath];
-    HLog(@"%@---%@", self.fileStreamDict, self.allTasks);
-    [[NSNotificationCenter defaultCenter] postNotificationName:CWUploadTaskExeEnd object:nil userInfo:@{@"fileStream":fileStream}];
-    
-}
-
-//配置全局默认的参数
-- (void)config:(NSMutableURLRequest *)request maxTask:(NSInteger)num
-{
-    if (!request.URL) {
-        HLog(@"request缺少URL");
-    }
-    [HWDataManager setIntegerWithKey:default_max value:num];
-    self.uploadMaxNum = 3;
-    self.url = request.URL;
-    self.request = request;
-}
-
-//设置最大任务数
-- (void)setUploadMaxNum:(NSInteger)uploadMaxNum
-{
-    if (_uploadMaxNum<3) {
-        _uploadMaxNum = uploadMaxNum;
-    }else if (_uploadMaxNum<0){
-        _uploadMaxNum = 3;
-    }else if(_uploadMaxNum>=3){
-        _uploadMaxNum = 3;
-    }
-}
-
-- (void)defaultsTask{
-    NSInteger tmpMax = [HWDataManager getIntegerWithKey:default_max];
-    self.uploadMaxNum = tmpMax?tmpMax:3;
-}
-
-/**
- 暂停一个上传任务
- */
-- (void)pauseUploadTask:(CWFileStreamSeparation *_Nonnull)fileStream
-{
-    CWUploadTask *task = [self.allTasks objectForKey:fileStream.fileName];
-    [task taskCancel];
-}
-
-/**
- 继续开始一个上传任务
- */
-- (void)resumeUploadTask:(CWFileStreamSeparation *_Nonnull)fileStream
-{
-    CWUploadTask *task = [self.allTasks objectForKey:fileStream.fileName];
-    [task taskResume];
-}
-
-/**
- 删除一个上传任务,同时会删除当前任务上传的缓存数据
- */
-- (void)removeUploadTask:(CWFileStreamSeparation *_Nonnull)fileStream
-{
-    CWUploadTask *task = [self.allTasks objectForKey:fileStream.fileName];
-    
-    [task taskCancel];
-    
-    if ([[self.allTasks allKeys] containsObject:fileStream.fileName]) {
-        [self.allTasks removeObjectForKey:fileStream.fileName];
-    }
-    
-    if ([[self.uploadingTasks allKeys] containsObject:fileStream.fileName]) {
-        [self.uploadingTasks removeObjectForKey:fileStream.fileName];
-    }
-
-    if (_fileStreamDict[fileStream.fileName]) {
-        _fileStreamDict = [self unArcherThePlist:self.plistPath];
-    }
-    [_fileStreamDict removeObjectForKey:fileStream.fileName];
-    
-    [self archerTheDictionary:_fileStreamDict file:self.plistPath];
-    
-    // 删除本地缓存的文件
-    NSString *fileFolder = kPath_YunPan_Upload_Folder;
-    NSString *fileName = fileStream.fileName;
-    NSString *fileURL = [fileFolder stringByAppendingPathComponent:fileName];
-//    HLog(@"%@--%@", fileURL, dict[@"fullPath"]);
-    if ([CWFileManager isExistsAtPath:fileURL]) {
-        BOOL flag = [[NSFileManager defaultManager] removeItemAtPath:fileURL error:nil];
-        HLog(@"上传文件删除结果:%d", flag);
-    }else {
-        HLog(@"上传文件删除失败 文件不存在");
-    }
-
-}
-
-/**
- 暂停所有的上传任务
- */
-- (void)pauseAllUploadTask
-{
-    for (CWUploadTask *task in [self.allTasks allValues]) {
-        [task taskCancel];
-    }
-}
-
-/**
- 启动所有上传任务
- */
-- (void)resumeAllUploadTask {
-    
-    if (self.allTasks.count == 0) {
-        return;
-    }
-
-    NSMutableDictionary *dic = [NSMutableDictionary dictionary];
-    [self.allTasks enumerateKeysAndObjectsUsingBlock:^(id  _Nonnull key, id  _Nonnull obj, BOOL * _Nonnull stop) {
-        CWUploadTask *task = obj;
-        if (task.fileStream.fileStatus == CWUploadStatusFinished || task.fileStream.progressRate == 1) { // 已完成的任务
-            HLog(@"该任务已完成---文件名:%@ 进度:%.2f 状态:%ld", task.fileStream.fileName, task.fileStream.progressRate, task.fileStream.fileStatus);
-        }else { // 所有未完成任务
-            [dic setObject:task forKey:key];
-            [task taskResume];
-        }
-    }];
-    
-//    NSArray *array = [dic allValues];
-//    NSArray *sortDesc = [NSArray arrayWithObject:[NSSortDescriptor sortDescriptorWithKey:@"timeStamp" ascending:YES]];
-//    NSArray *sortedArr = [array sortedArrayUsingDescriptors:sortDesc];
-}
-
-/**
-删除所有的上传任务
- */
-- (void)removeAllUploadTask
-{
-    for (CWUploadTask *task in [self.allTasks allValues]) {
-        [self removeUploadTask:task.fileStream];
-    }
-}
-
-/**
- 获取所有文件分片模型的上传任务字典
- */
-- (NSMutableDictionary<NSString*,CWUploadTask*>*_Nullable)allUploadTasks
-{
-    if (self.fileStreamDict.count == 0) {
-        self.fileStreamDict = [self unArcherThePlist:self.plistPath];
-    }
-    NSDictionary *tmpDict = _allTasks?_allTasks:@{};
-    NSMutableDictionary *fileWithTasks = [CWUploadTask uploadTasksWithDict:_instance.fileStreamDict];
-    
-    [fileWithTasks addEntriesFromDictionary:tmpDict];
-    return fileWithTasks;
-}
-
-- (NSMutableDictionary<NSString*,CWUploadTask*>*_Nullable)allUploadWaitTasks
-{
-    NSMutableDictionary *dic = [NSMutableDictionary dictionary];
-    [self.allTasks enumerateKeysAndObjectsUsingBlock:^(id  _Nonnull key, id  _Nonnull obj, BOOL * _Nonnull stop) {
-        CWUploadTask *task = obj;
-        if (task.fileStream.fileStatus == CWUploadStatusWaiting &&
-            task.fileStream.fileStatus != CWUploadStatusFailed) {
-            [dic setObject:task forKey:key];
-        }
-    }];
-    return dic;
-}
-
-- (NSMutableDictionary<NSString*,CWUploadTask*>*_Nullable)allUploadEndTasks
-{
-    NSMutableDictionary *dic = [NSMutableDictionary dictionary];
-    [self.uploadingTasks enumerateKeysAndObjectsUsingBlock:^(id  _Nonnull key, id  _Nonnull obj, BOOL * _Nonnull stop) {
-        CWUploadTask *task = obj;
-        if (task.fileStream.fileStatus == CWUploadStatusFinished) {
-            [dic setObject:task forKey:key];
-        }
-    }];
-    return dic;
-}
-
-- (NSMutableDictionary<NSString*,CWUploadTask*>*_Nullable)allUploadingTasks
-{
-    NSMutableDictionary *dic = [NSMutableDictionary dictionary];
-    [self.allTasks enumerateKeysAndObjectsUsingBlock:^(id  _Nonnull key, id  _Nonnull obj, BOOL * _Nonnull stop) {
-        CWUploadTask *task = obj;
-        if (task.fileStream.fileStatus == CWUploadStatusUpdownloading) {
-            [dic setObject:task forKey:key];
-        }
-    }];
-
-    return dic;
-}
-
-#pragma 工具方法
-- (CWUploadTask *)continuePerformTaskWithFilePath:(NSString *)path{
-    
-    //获取任务数据字段
-    CWFileStreamSeparation *fstream = [self.fileStreamDict objectForKey:path.lastPathComponent];
-    CWUploadTask *uploadTask = self.allTasks[path.lastPathComponent];
-    if (!uploadTask) {
-        uploadTask = [CWUploadTask initWithStreamModel:fstream];
-        [self.allTasks setObject:uploadTask forKey:path.lastPathComponent];
-    }
-//    [uploadTask taskResume];
-    return uploadTask;
-}
-
-+ (BOOL)isUploadTask:(NSString *)path{
-    _instance = [CWFileUploadManager shardUploadManager];
-    if (![CWFileManager isFileAtPath:_instance.plistPath]) {
-        [CWFileManager createFileAtPath:_instance.plistPath overwrite:NO];
-    }
-    _instance.fileStreamDict = [_instance unArcherThePlist:_instance.plistPath];
-    if (_instance.fileStreamDict[path.lastPathComponent] == nil) {
-        return NO;
-    }else{
-        return YES;
-    }
-}
-
-//新建任务分片模型并存入plist文件
-- (CWFileStreamSeparation * _Nullable)taskRecord:(NSString *)path{
-    
-    CWFileStreamSeparation *file = [[CWFileStreamSeparation alloc] initFileOperationAtPath:path forReadOperation:YES];
-    [self.fileStreamDict setObject:file forKey:path.lastPathComponent];
-    
-    [self archerTheDictionary:_fileStreamDict file:self.plistPath];
-    
-    return file;
-}
-
-//新建任务分片模型并存入plist文件
-- (CWFileStreamSeparation * _Nullable)taskRecord:(NSString *)path uploadLocation:(NSString *)uploadLocation imageData:(NSData *)imageData {
-    
-    CWFileStreamSeparation *file = [[CWFileStreamSeparation alloc] initFileOperationAtPath:path forReadOperation:YES uploadLocation:uploadLocation imageData:imageData];
-    [self.fileStreamDict setObject:file forKey:path.lastPathComponent];
-    
-    [self archerTheDictionary:_fileStreamDict file:self.plistPath];
-    
-    return file;
-}
-
-#pragma mark - notification
-
-- (void)registeNotification{
-    HLog(@"del 2024525  暂未做");
-    /* hxd del 2024525  暂未做
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationBecomeActive) name:UIApplicationDidBecomeActiveNotification object:nil];
-    
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(taskExeEnd:) name:CWUploadTaskExeEnd object:nil];
-    
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(taskExeSuspend:) name:CWUploadTaskExeSuspend object:nil];
-    
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(taskExeError:) name:CWUploadTaskExeError object:nil];
-    
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(accountChange) name:ChangeAccountNotification object:nil];
-
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(exchanggeAccount) name:ExchangeLoginAccountNotification object:nil];
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(exchanggeAccount) name:AccountLoginOutsideNotification object:nil];
-     */
-}
-
-//app启动或者app从后台进入前台都会调用这个方法
-- (void)applicationBecomeActive{
-    [self uploadingTasksItemExe];
-}
-
-- (void)taskExeSuspend:(NSNotification *)notification
-{
-    CWFileStreamSeparation *fs = notification.userInfo.allValues.firstObject;
-    [self.uploadingTasks removeObjectForKey:fs.fileName];
-    
-    [self.allTasks enumerateKeysAndObjectsUsingBlock:^(id  _Nonnull key, id  _Nonnull obj, BOOL * _Nonnull stop) {
-        CWUploadTask *task = obj;
-        if (task.fileStream.fileStatus == CWUploadStatusWaiting &&
-            self.uploadingTasks.allValues.count < self.uploadMaxNum) {
-            [[CWFileUploadManager shardUploadManager] resumeUploadTask:task.fileStream];
-        }
-    }];
-    
-    [self allUploadingTasks];
-}
-
-- (void)taskExeEnd:(NSNotification *)notification
-{
-    CWFileStreamSeparation *fs = notification.userInfo.allValues.firstObject;
-    [self.uploadingTasks removeObjectForKey:fs.fileName];
-    [self.uploadWaitTasks enumerateKeysAndObjectsUsingBlock:^(id  _Nonnull key, id  _Nonnull obj, BOOL * _Nonnull stop) {
-        CWUploadTask *task = obj;
-        if (self.uploadingTasks.allValues.count < self.uploadMaxNum) {
-            [task taskResume];
-        }else{
-            *stop = YES;
-        }
-    }];
-    [self allUploadingTasks];
-}
-
-- (void)taskExeError:(NSNotification *)notification
-{
-    CWFileStreamSeparation *fs = notification.userInfo[@"fileStream"];
-    NSError *error = (NSError *)notification.userInfo[@"error"];
-    [self.uploadingTasks removeObjectForKey:fs.fileName];
-    HLog(@"taskError:%@",error);
-}
-
-- (void)uploadingTasksItemExe{
-    NSDictionary *dict = [NSDictionary dictionaryWithDictionary:self.uploadingTasks];
-    [self.uploadingTasks removeAllObjects];
-    [dict enumerateKeysAndObjectsUsingBlock:^(id  _Nonnull key, id  _Nonnull obj, BOOL * _Nonnull stop) {
-        CWUploadTask *task = obj;
-        [task taskResume];
-    }];
-    [self.uploadWaitTasks enumerateKeysAndObjectsUsingBlock:^(id  _Nonnull key, id  _Nonnull obj, BOOL * _Nonnull stop) {
-        CWUploadTask *task = obj;
-        if (self.uploadingTasks.allValues.count<self.uploadMaxNum) {
-            [task taskResume];
-        }else{
-            *stop = YES;
-        }
-    }];
-    [self allUploadingTasks];
-}
-
-- (void)accountChange { // 修改账号
-    self.plistPath = [self getNewPlistPath];
-}
-
-- (void)exchanggeAccount { // 切换账号
-    HLog(@"切换账号");
-    
-    [self pauseAllUploadTask]; // 暂停所有上传任务
-    
-    self.plistPath = [self getNewPlistPath];
-    [self.allTasks removeAllObjects];
-    self.allTasks = nil;
-    [self.fileStreamDict removeAllObjects];
-    [self clearCookies];
-}
-
-// 清空Cookie
-- (void)clearCookies {
-    
-    NSHTTPCookieStorage *cookieJar = [NSHTTPCookieStorage sharedHTTPCookieStorage];
-    NSArray *cookieArray = [NSArray arrayWithArray:[cookieJar cookies]];
-    for(id obj in cookieArray)
-    {
-        [cookieJar deleteCookie:obj];
-    }
-}
-
-#pragma mark - tools
-//归档
-- (void)archerTheDictionary:(NSDictionary *)dict file:(NSString *)path{
-    [HWDataManager archiveObject:dict toPlistPath:path];
-}
-
-//解档
-- (NSMutableDictionary *)unArcherThePlist:(NSString *)path{
-    NSMutableDictionary *dic = [HWDataManager readObjectFromPlistPath:path];
-    return dic;
-}
-
-#pragma mark - 相册文件写入Cache
-/// 将相册里的视频文件缓存到Cache
-- (NSString *_Nullable)writeVideoDataFromURL:(NSURL *_Nullable)url uploadLocation:(NSString *_Nullable)uploadLocation {
-    
-    NSString *account = [HWDataManager getStringWithKey:Const_HWAccountPhoneNumber];
-    if (account.length != 0) {
-         NSString *fileFolder = kPath_YunPan_Upload_Folder;
-         NSString *originalPath = [url.absoluteString stringByReplacingOccurrencesOfString:@"file://" withString:@""];
-         NSString *fileName;
-//         fileName = [NSString stringWithFormat:@"%@/%@", uploadLocation,fileName];
-         fileName = [NSString stringWithFormat:@"%@",  [iTools getNowTimeStampString]];
-         
-         NSString *videoName = [NSString stringWithFormat:@"SZX%@.mp4", fileName];
-         NSString *sandboxPath = [fileFolder stringByAppendingPathComponent:videoName];
-         NSError * error = nil;
-         BOOL isSuccess = [CWFileManager moveItemAtPath:originalPath toPath:sandboxPath overwrite:YES error:&error];
-         HLog(@"保存相册视频文件:%@到Caches:%@是否成功:%d error:%@", originalPath, sandboxPath,isSuccess,error);
-         return sandboxPath;
-     }else {
-         HLog(@"未登录 缓存视频文件失败!");
-         return nil;
-     }
-    
-
-}
-
-/// 将相册里的图片文件缓存到Cache
-- (NSString *_Nullable)writeIamgeData:(NSData *_Nullable)data iamgeName:(NSString *_Nullable)iamgeName uploadLocation:(NSString *_Nullable)uploadLocation {
-     NSString *account = [HWDataManager getStringWithKey:Const_HWAccountPhoneNumber];
-
-    if (account.length != 0) {
-         NSString *fileFolder = kPath_YunPan_Upload_Folder;
-         NSString *fileName = [NSString stringWithFormat:@"SZX%@",  [iTools getNowTimeStampString]];
-         
-         NSString *videoName = [NSString stringWithFormat:@"%@.PNG", fileName];
-         NSString *sandboxPath = [fileFolder stringByAppendingPathComponent:videoName];
-         BOOL isSuccess = [data writeToFile:sandboxPath atomically:YES];
-         HLog(@"保存相册图片文件到Caches是否成功:%d", isSuccess);
-         return sandboxPath;
-     }else {
-         HLog(@"未登录 缓存图片文件失败!");
-         return nil;
-     }
-
-}
-
-- (NSString *_Nullable)writeIamgeDataToLocal:(NSData *_Nullable)data {
-
-     NSString *account = [HWDataManager getStringWithKey:Const_HWAccountPhoneNumber];
-     if (account.length != 0) {
-         NSString *fileFolder = kPath_YunPan_Upload_Folder;
-         NSString *fileName = [NSString stringWithFormat:@"SZX%@",  [iTools getNowTimeStampString]];
-         
-         NSString *videoName = [NSString stringWithFormat:@"%@.PNG", fileName];
-         NSString *sandboxPath = [fileFolder stringByAppendingPathComponent:videoName];
-         BOOL isSuccess = [data writeToFile:sandboxPath atomically:YES];
-         HLog(@"保存相册图片文件到Caches是否成功:%d", isSuccess);
-         return sandboxPath;
-     }else {
-         HLog(@"未登录 缓存图片文件失败!");
-         return nil;
-     }
-
-}
-
-@end

+ 0 - 15
创维盒子/code/Vendor/UploadManager/CWUploadManage/CWUploadTask+CheckInfo.h

@@ -1,15 +0,0 @@
-//
-//  CWUploadTask+CheckInfo.h
-//  uploadFileDemo
-//
-//  Created by hyjet on 2018/3/9.
-//  Copyright © 2018年 uploadFileDemo. All rights reserved.
-//
-
-#import "CWUploadTask.h"
-
-@interface CWUploadTask (CheckInfo)
-
-- (void)checkParamFromServer:(CWFileStreamSeparation *_Nonnull)fileStream
-              paramCallback:(void(^ _Nullable)(NSString *_Nonnull chunkNumName,NSDictionary *_Nullable param))paramBlock;
-@end

+ 0 - 123
创维盒子/code/Vendor/UploadManager/CWUploadManage/CWUploadTask+CheckInfo.m

@@ -1,123 +0,0 @@
-//
-//  CWUploadTask+CheckInfo.m
-//  uploadFileDemo
-//
-//  Created by hyjet on 2018/3/9.
-//  Copyright © 2018年 uploadFileDemo. All rights reserved.
-//
-
-#import "CWUploadTask+CheckInfo.h"
-#import "CWFileStreamSeparation.h"
-
-
-#define CURRENT_API @""
-
-#define GETPOSTFLOWCHUNKAPI       @"/nextcloud/index.php/apps/rcapi/ajax/upload.php"/*断点续传*/
-
-@implementation CWUploadTask (CheckInfo)
-
-- (void)checkParamFromServer:(CWFileStreamSeparation *_Nonnull)fileStream paramCallback:(void(^ _Nullable)(NSString *_Nonnull chunkNumName,NSDictionary *_Nullable param))paramBlock
-{
-    
-    HLog(@"del 2024525  暂未做");
-    /* hxd del 2024525  暂未做
-    HLog(@"GET之前——--文件名:%@ 已上传完进度:%.2f 上传状态:%ld", fileStream.fileName, fileStream.progressRate, fileStream.fileStatus);
-//    HLog(@"IP地址:%@", [iPhone phoneDeviceIPAddress]);
-    /// 请求URL
-    NSDictionary *dictLogin = [[UseAccountManage shareInstance] getLoginInfo];
-    NSString *mCloudService = @"";
-    if (dictLogin && [[dictLogin allKeys] containsObject:@"nextCloudIp"])
-    {
-        mCloudService = [NSString stringWithFormat:@"http://%@",[dictLogin objectForKey:@"nextCloudIp"]];
-    }
-    else
-    {
-        return;
-    }
-    NSString *urlString = [mCloudService stringByAppendingString:GETPOSTFLOWCHUNKAPI];
-
-    for (NSInteger i=0; i<fileStream.streamFragments.count; i++) {
-        CWStreamFragment *fragment = fileStream.streamFragments[i];
-        if (fragment.fragmentStatus) { // 已上传
-            continue;
-        }else { // 未上传
-            NSString *flowFilename = fileStream.fileName;
-            NSString *flowFilenameWithoutPoint = [flowFilename stringByReplacingOccurrencesOfString:@"." withString:@""];
-            NSString *flowIdentifier = [NSString stringWithFormat:@"%ld-%@", fileStream.fileSize, flowFilenameWithoutPoint];
-            NSString *flowRelativePath = @"";
-            if ([fileStream.uploadLocation isEqualToString:@"/"]) {
-                flowRelativePath = [NSString stringWithFormat:@"%@", flowFilename];
-            }else {
-                flowRelativePath = [NSString stringWithFormat:@"%@/%@", fileStream.uploadLocation, flowFilename];
-            }
-            /// 请求参数paramsDict
-            NSMutableDictionary *paramsDict = [[NSMutableDictionary alloc] init];
-            [paramsDict setValue:@(i+1) forKey:@"flowChunkNumber"]; // 当前第几块
-            [paramsDict setValue:@(CWStreamFragmentMaxSize) forKey:@"flowChunkSize"];   // 块定义上传大小
-            [paramsDict setValue:@(fragment.fragmentSize) forKey:@"flowCurrentChunkSize"];  // 当前块大小
-            [paramsDict setValue:@(fileStream.fileSize) forKey:@"flowTotalSize"];  // 总大小
-            [paramsDict setValue:flowIdentifier forKey:@"flowIdentifier"];  // 标识符【规则:总大小-文件名+文件后缀】
-            [paramsDict setValue:flowFilename forKey:@"flowFilename"];  // 文件名
-            [paramsDict setValue:flowRelativePath forKey:@"flowRelativePath"]; // 文件存储路径
-            [paramsDict setValue:@(fileStream.streamFragments.count) forKey:@"flowTotalChunks"];  // 块总数
-//            NSString *args = [iTools getJSONStringFromDictionary:paramsDict];
-//            HLog(@"GET——URL:%@---params:%@", urlString,paramsDict);
-            /// 拼接参数
-            NSString *requestURLString = [NSString stringWithFormat:@"%@?flowChunkNumber=%ld&flowChunkSize=%d&flowCurrentChunkSize=%ld&flowTotalSize=%ld&flowIdentifier=%@&flowFilename=%@&flowRelativePath=%@&flowTotalChunks=%ld", urlString, (i+1), CWStreamFragmentMaxSize, fragment.fragmentSize, fileStream.fileSize, flowIdentifier, flowFilename, flowRelativePath, fileStream.streamFragments.count];
-            NSString *requestURLEncodedString = [requestURLString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; // URL中不能有中文
-
-            /// 创建请求 设置请求头Authorization
-            NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:requestURLEncodedString]];
-            NSString *tokenStr = @"";
-            if (dictLogin && [[dictLogin allKeys] containsObject:@"token"]) {
-                tokenStr = [[UseAccountManage shareInstance] cloudAutoh];
-                if (tokenStr.length == 0) {
-                    HLog(@"POST:未能成功获取到Authorization");
-                    return;
-                }
-            }else {
-                HLog(@"POST:未能成功获取到Authorization");
-                return;
-            }
-
-            [request setValue:tokenStr forHTTPHeaderField:@"Authorization"];
-            [request setValue:fileStream.md5String forHTTPHeaderField:@"onlycrypt"]; // 文件MD5值
-            request.HTTPMethod = @"GET";// 设置请求类型 先GET查询 再POST上传
-            NSURLSession *session = [NSURLSession sharedSession];
-  
-            //发送请求
-            NSURLSessionDataTask *postTask = [session dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {
-                if (error == nil) {
-                    //解析得到的数据
-                    NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:nil];
-                    HLog(@"GET之后:获取断点续传分片信息成功 校验参数 更新paramsDict  返回:%@", dict);
-                    paramBlock(@"flowChunkNumber",paramsDict);
-                }else {
-                    HLog(@"GET之后:获取断点续传分片信息失败 %@", error);
-                }
-                
-                [self clearCookies];
-            }];
-            
-            [postTask resume];
-            
-            
-            break;
-            
-        }
-    }
-     */
-}
-
-// 清空Cookie
-- (void)clearCookies {
-    
-    NSHTTPCookieStorage *cookieJar = [NSHTTPCookieStorage sharedHTTPCookieStorage];
-    NSArray *cookieArray = [NSArray arrayWithArray:[cookieJar cookies]];
-    for(id obj in cookieArray)
-    {
-        [cookieJar deleteCookie:obj];
-    }
-}
-
-@end

+ 0 - 77
创维盒子/code/Vendor/UploadManager/CWUploadManage/CWUploadTask.h

@@ -1,77 +0,0 @@
-//
-//  CWUploadTask.h
-//  CWPlayer
-//
-//  Created by hyjet on 2017/10/12.
-//  Copyright © 2017年 CWPlayer. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-@class CWFileStreamSeparation;
-
-#ifdef __cplusplus
-#define TASK_EXTERN        extern "C" __attribute__((visibility ("default")))
-#else
-#define TASK_EXTERN            extern __attribute__((visibility ("default")))
-#endif
-
-/**
- 通知监听上传状态的key
- */
-TASK_EXTERN NSString * _Nonnull const CWUploadTaskExeing;      //上传中
-TASK_EXTERN NSString * _Nonnull const CWUploadTaskExeError;    //上传失败
-TASK_EXTERN NSString * _Nonnull const CWUploadTaskExeEnd;      //上传完成
-TASK_EXTERN NSString * _Nonnull const CWUploadTaskExeSuspend;  //上传暂停/取消
-
-typedef void(^finishHandler)(CWFileStreamSeparation * _Nullable fileStream, NSError * _Nullable error);
-
-typedef void(^success)(CWFileStreamSeparation * _Nullable fileStream);
-
-@interface CWUploadTask : NSObject
-
-@property (nonatomic,readonly,strong)CWFileStreamSeparation *_Nullable fileStream;
-//当前上传任务的URL
-@property (nonatomic,readonly,strong)NSURL * _Nullable url;
-//当前上传任务的参数
-@property (nonatomic,readonly,strong)NSMutableDictionary * _Nullable param;
-//任务对象的执行状态
-//@property (nonatomic,readonly,assign)NSURLSessionTaskState taskState;
-//上传任务的唯一ID
-@property (nonatomic,readonly,copy)NSString * _Nullable ID;
-//任务时间戳
-@property (nonatomic, assign)  NSInteger timeStamp;    //时间戳
-
-/**
- 根据一个文件分片模型创建一个上传任务,执行 taskResume 方法开始上传
- 使用 listenTaskExeCallback 方法传递block进行回调监听
- 同时也可以选择实现协议方法进行回调监听
- */
-+ (instancetype _Nonnull )initWithStreamModel:(CWFileStreamSeparation * _Nonnull)fileStream;
-
-/**
- 监听一个已存在的上传任务的状态
- */
-- (void)listenTaskExeCallback:(finishHandler _Nonnull)block
-                      success:(success _Nonnull)successBlock;
-
-/**
- 根据一个文件分片模型的字典创建一个上传任务(处于等待状态)字典
- */
-+ (NSMutableDictionary<NSString*,CWUploadTask*> *_Nullable)uploadTasksWithDict:(NSDictionary<NSString*,CWFileStreamSeparation*> *_Nullable)dict;
-
-/**
- 根据一个文件分片模型创建一个上传任务,执行 startExe 方法开始上传,结果会由block回调出来
- */
-- (instancetype _Nonnull)initWithStreamModel:(CWFileStreamSeparation *_Nonnull)fileStream
-                                      finish:(finishHandler _Nonnull)block
-                                     success:(success _Nonnull)successBlock;
-
-
-//继续/开始上传
-- (void)taskResume;
-
-//取消/暂停上传
-- (void)taskCancel;
-
-
-@end

+ 0 - 449
创维盒子/code/Vendor/UploadManager/CWUploadManage/CWUploadTask.m

@@ -1,449 +0,0 @@
-//
-//  CWUploadTask.m
-//  uploadFileDemo
-//
-//  Created by hyjet on 2018/3/9.
-//  Copyright © 2018年 uploadFileDemo. All rights reserved.
-//
-
-#import "CWUploadTask.h"
-#import "CWFileUploadManager.h"
-#import "CWFileStreamSeparation.h"
-#import "CWFileManager.h"
-#import "CWUploadTask+CheckInfo.h"
-
-//分隔符
-#define Boundary @"1a2b3c"
-//一般换行
-#define Wrap1 @"\r\n"
-//key-value换行
-#define Wrap2 @"\r\n\r\n"
-//开始分割
-#define StartBoundary [NSString stringWithFormat:@"--%@%@",Boundary,Wrap1]
-//文件分割完成
-#define EndBody [NSString stringWithFormat:@"--%@--",Boundary]
-//一个片段上传失败默认重试3次
-#define REPEAT_MAX 3
-
-//#define plistPath [[CWFileManager cachesDir] stringByAppendingPathComponent:uploadPlist]
-
-#define GETPOSTFLOWCHUNKAPI       @"/nextcloud/index.php/apps/rcapi/ajax/upload.php"/*断点续传*/
-
-NSString *const CWUploadTaskExeing = @"TaskExeing";
-NSString *const CWUploadTaskExeError = @"TaskExeError";
-NSString *const CWUploadTaskExeEnd = @"TaskExeEnd";
-NSString *const CWUploadTaskExeSuspend = @"TaskExeSuspend";
-
-@interface CWUploadTask ()
-
-//@property (nonatomic,strong)NSURLSessionUploadTask *uploadTask;
-
-//@property (nonatomic,strong)NSMutableURLRequest *request;
-
-//@property (nonatomic,readwrite)NSURLSessionTaskState taskState;
-
-@property (nonatomic,readwrite)NSURL * url;
-
-@property (nonatomic,readwrite)NSString *ID;
-
-@property (nonatomic,readwrite)NSMutableDictionary *param;//上传时参数
-
-@property (nonatomic,readwrite)CWFileStreamSeparation *fileStream;
-
-@property (nonatomic,copy)finishHandler finishBlock;//片段上传成功上传的回调block
-
-@property (nonatomic,copy)success successBlock;//整体上传成功上传的回调block
-
-@property (nonatomic,copy)NSString *chunkNumName;//片段编号这一参数的参数名
-
-@property (nonatomic,copy)NSDictionary *lastParam;//片段完成上传后的参数
-
-@property (nonatomic,assign)NSInteger chunkNo;//片段完成上传后的编号
-
-@property (nonatomic,assign)NSInteger taskRepeatNum;//重试次数
-
-@property (nonatomic,assign)BOOL isSuspendedState;//记录状态更改
-
-@property (nonatomic,strong)CWFileUploadManager *uploadManager;
-
-@end
-
-@implementation CWUploadTask
-
--(CWFileUploadManager *)uploadManager
-{
-    if (!_uploadManager) {
-        _uploadManager = [CWFileUploadManager shardUploadManager];
-    }
-    return _uploadManager;
-}
-
-
-- (void)setFileStream:(CWFileStreamSeparation *)fileStream
-{
-    _fileStream.fileStatus = CWUploadStatusWaiting;
-    _taskRepeatNum = 0;
-    _ID = fileStream.md5String;
-    for (NSInteger idx=0; idx<fileStream.streamFragments.count; idx++) {
-        CWStreamFragment *fragment = fileStream.streamFragments[idx];
-        if (!fragment.fragmentStatus) {
-            _chunkNo = idx;
-        }
-    }
-    _fileStream = fileStream;
-}
-
-
-+ (NSMutableDictionary<NSString*,CWUploadTask*> *)uploadTasksWithDict:(NSDictionary<NSString*,CWFileStreamSeparation*> *)dict{
-    NSMutableDictionary *taskDict = [NSMutableDictionary dictionary];
-    for (NSString *key in dict.allKeys) {
-        CWFileStreamSeparation *fs = [dict objectForKey:key];
-        CWUploadTask *task = [CWUploadTask initWithStreamModel:fs];
-        [taskDict setValue:task forKey:key];
-    }
-    return taskDict;
-}
-
-+ (instancetype)initWithStreamModel:(CWFileStreamSeparation *)fileStream
-{
-    CWUploadTask *task = [CWUploadTask new];
-    task.fileStream = fileStream;
-    task.timeStamp = [iTools getNowTimeStamp];
-    task.isSuspendedState = NO;
-    task.url = [CWFileUploadManager shardUploadManager].url;
-    return task;
-}
-
-- (void)listenTaskExeCallback:(finishHandler _Nonnull)block success:(success)successBlock
-{
-    self.finishBlock = block;
-    self.successBlock = successBlock;
-    if (_finishBlock) _finishBlock(_fileStream,nil);
-}
-
-
-- (instancetype _Nonnull)initWithStreamModel:(CWFileStreamSeparation *)fileStream finish:(finishHandler _Nonnull)block success:(success)successBlock
-
-{
-    if (self = [super init]) {
-        self.fileStream = fileStream;
-        _finishBlock = block;
-        _successBlock = successBlock;
-    }
-    return self;
-}
-
-//-(NSMutableURLRequest*)uploadRequest
-//{
-//    if ([CWFileUploadManager shardUploadManager].request) {
-//        _request = [CWFileUploadManager shardUploadManager].request;
-//    }else{
-//        HLog(@"请配置上传任务的request");
-//    }
-//    return _request;
-//
-//}
-
--(NSData*)taskRequestBodyWithParam:(NSDictionary *)param uploadData:(NSData *)data
-{
-    NSMutableData* totlData=[NSMutableData new];
-
-    NSArray* allKeys=[param allKeys];
-    for (int i=0; i<allKeys.count; i++)
-    {
-        
-        NSString *disposition = [NSString stringWithFormat:@"%@Content-Disposition: form-data; name=\"%@\"%@",StartBoundary,allKeys[i],Wrap2];
-        NSString* object=[param objectForKey:allKeys[i]];
-        disposition =[disposition stringByAppendingString:[NSString stringWithFormat:@"%@",object]];
-        disposition =[disposition stringByAppendingString:Wrap1];
-        [totlData appendData:[disposition dataUsingEncoding:NSUTF8StringEncoding]];
-        
-    }
-    NSString *body=[NSString stringWithFormat:@"%@Content-Disposition: form-data; name=\"picture\"; filename=\"%@\";Content-Type:video/mpeg4%@",StartBoundary,@"file",Wrap2];
-    [totlData appendData:[body dataUsingEncoding:NSUTF8StringEncoding]];
-    [totlData appendData:data];
-    [totlData appendData:[Wrap1 dataUsingEncoding:NSUTF8StringEncoding]];
-    [totlData appendData:[EndBody dataUsingEncoding:NSUTF8StringEncoding]];
-    
-    
-    return totlData;
-}
-
-/**
- *  GET:上传任务 获取上传文件相关信息
- */
-- (void)getFileInfo
-{
-    __weak typeof(self) weekSelf = self;
-    [self checkParamFromServer:self.fileStream paramCallback:^(NSString * _Nonnull chunkNumName, NSDictionary * _Nullable param) {
-        weekSelf.chunkNumName = chunkNumName;
-        weekSelf.param = [NSMutableDictionary dictionaryWithDictionary:param];
-        [weekSelf startExe];
-    }];
-}
-
-/**
-*  POST:上传任务 获取上传文件相关信息
-*/
-- (void)startExe{
-    HLog(@"del 2024525  暂未做");
-    /* hxd del 2024525  暂未做
-     
-    if (_isSuspendedState) {
-        HLog(@"暂停上传");
-        [self taskCancel];
-        return;
-    }
-    
-    //判断无参数的情况下先将文件信息上传并获得参数
-    if (!_param) [self getFileInfo];
-    dispatch_group_t group = dispatch_group_create();
-    dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
-    dispatch_queue_t queue = dispatch_queue_create(NULL, DISPATCH_QUEUE_SERIAL);
-    
-    if (_fileStream.fileStatus == CWUploadStatusFinished && _successBlock) {
-        _successBlock(_fileStream);
-        [self sendNotionWithKey:CWUploadTaskExeEnd userInfo:@{@"fileStream":_fileStream}];
-        return;
-    };
-    
-    CWStreamFragment *fragment;
-    for (NSInteger i=0; i<_fileStream.streamFragments.count; i++) {
-        fragment = _fileStream.streamFragments[i];
-        if (fragment.fragmentStatus) { // 已上传
-            continue;
-        }else { // 未上传
-            [self->_param setObject:[NSString stringWithFormat:@"%zd",(i+1)] forKey:@"flowChunkNumber"];
-            [self->_param setObject:@(fragment.fragmentSize) forKey:@"flowCurrentChunkSize"];
-            
-            dispatch_group_async(group, queue, ^{
-               @autoreleasepool {
-                   NSData *data = [self->_fileStream readDateOfFragment:fragment];
-                   self.lastParam = self->_param;
-                   
-//                   if ([CWFileUploadManager shardUploadManager].leftStore < data.length) { // 云盘空间不足
-//
-//                       // 分片上传失败
-//                       self->_fileStream.fileStatus = CWUploadStatusFailed;
-//                       self->_fileStream.timeStamp = [iTools getNowTimeStamp];
-//                       [self archTaskFileStream];
-//                       // 分片上传失败通知 刷新列表
-//                       dispatch_async(dispatch_get_main_queue(), ^{
-//                           NSString *error = @"云盘剩余空间不足";
-//                           [self sendNotionWithKey:CWUploadTaskExeError userInfo:@{@"fileStream":self->_fileStream,@"error":error}];
-//                           [self sendNotionWithKey:CloudStoreIsFullNotification userInfo:@{}];
-//                       });
-//                       [self deallocSession];
-//                       return;
-//                   }
-
-                   HLog(@"POST之前——--文件名:%@ 已上传完进度:%.2f 上传状态:%ld", self->_fileStream.fileName, self->_fileStream.progressRate, self->_fileStream.fileStatus);
-                   [[UseAccountManage shareInstance] doUploadInfoWithParams:self->_param md5string:self->_fileStream.md5String data:data success:^(id  _Nonnull responseObject) {
-
-                       self->_taskRepeatNum = 0;
-                       fragment.fragmentStatus = YES;
-                       [self archTaskFileStream];
-                       self->_chunkNo = i+1;
-                       
-                       dispatch_async(dispatch_get_main_queue(), ^{
-
-                           if (self->_fileStream.streamFragments.count == self->_chunkNo) {
-                               // 分片上传成功 是最后一片 上传完
-                               self->_fileStream.fileStatus = CWUploadStatusFinished;
-                               self->_fileStream.progressRate = 1.00;
-                               self->_fileStream.uploadDateSize = self->_fileStream.fileSize;
-                               self->_fileStream.timeStamp = [iTools getNowTimeStamp];
-                               [self archTaskFileStream];
-                               
-                               HLog(@"POST之后——--文件名:%@ 已上传完进度:%.2f 上传状态:%ld", self->_fileStream.fileName, self->_fileStream.progressRate, self->_fileStream.fileStatus);
-                               
-                               // 上传完成通知 刷新完成列表
-                               dispatch_async(dispatch_get_main_queue(), ^{
-                                   if (self->_finishBlock) self->_finishBlock(self->_fileStream,nil);
-                                   [self sendNotionWithKey:CWUploadTaskExeEnd userInfo:@{@"fileStream":self->_fileStream}];
-                               });
-                               
-                           }else {
-                               // 分片上传成功 不是最后一片 上传中
-                               if (self->_fileStream.uploadDateSize > self->_chunkNo * CWStreamFragmentMaxSize) { // 上传进度异常
-                                   HLog(@"上传进度异常");
-                               }else {
-//                               self->_fileStream.fileStatus = CWUploadStatusUpdownloading;
-                                   self->_fileStream.progressRate = self->_chunkNo * 1.00 / self->_fileStream.streamFragments.count;
-                                   self->_fileStream.uploadDateSize = self->_chunkNo * CWStreamFragmentMaxSize;
-                                   self->_fileStream.timeStamp = [iTools getNowTimeStamp];
-                                   [self archTaskFileStream];
-                                   
-                                   HLog(@"POST之后——--文件名:%@ 已上传完进度:%.2f 上传状态:%ld", self->_fileStream.fileName, self->_fileStream.progressRate, self->_fileStream.fileStatus);
-                                    
-                                    // 上传中通知 刷新上传进度
-                                    dispatch_async(dispatch_get_main_queue(), ^{
-                                        if (self->_finishBlock) self->_finishBlock(self->_fileStream,nil);
-                                        [self sendNotionWithKey:CWUploadTaskExeing userInfo:@{@"fileStream":self->_fileStream,@"lastParam":self->_lastParam,@"indexNo":@(self->_chunkNo)}];
-                                    });
-                               }
-
-                               /// 继续GET
-                               [self getFileInfo];
-                           }
-                           
-                         [self deallocSession];
-                           
-                       });
-                       dispatch_semaphore_signal(semaphore);
-
-                   } faild:^(NSError * _Nonnull error) {
-                       
-                       if (self->_taskRepeatNum<REPEAT_MAX) { // 分片上传失败 重试3次
-                           
-                            self->_taskRepeatNum++;
-                            [self startExe];
-                        }else{
-                            // 分片上传失败
-                            self->_fileStream.fileStatus = CWUploadStatusFailed;
-//                            self->_fileStream.progressRate = (self->_chunkNo-1) / self->_fileStream.streamFragments.count;
-//                            self->_fileStream.uploadDateSize = (self->_chunkNo-1) * CWStreamFragmentMaxSize;
-                            self->_fileStream.timeStamp = [iTools getNowTimeStamp];
-                            [self archTaskFileStream];
-                            
-                            HLog(@"POST之后——--文件名:%@ 已上传完进度:%.2f 上传状态:%ld", self->_fileStream.fileName, self->_fileStream.progressRate, self->_fileStream.fileStatus);
-                            
-                            // 分片上传失败通知 刷新列表
-                            dispatch_async(dispatch_get_main_queue(), ^{
-                                if (self->_finishBlock) self->_finishBlock(self->_fileStream,error);
-                                [self sendNotionWithKey:CWUploadTaskExeError userInfo:@{@"fileStream":self->_fileStream,@"error":error}];
-                            });
-                            
-                            [self deallocSession];
-                            return;
-                        }
-                       
-                   }];
-                   
-                   dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
-               }
-           });
-            break;
-        }
-    }
-    
-    dispatch_group_notify(group, queue, ^{
-        
-        if (self->_fileStream.progressRate != 1) {
-            HLog(@"dispatch_group_notify: %.2f", self->_fileStream.progressRate);
-            return;
-        }
-        
-        self->_fileStream.fileStatus = CWUploadStatusFinished;
-        self->_fileStream.timeStamp = [iTools getNowTimeStamp];
-        [self archTaskFileStream];
-        dispatch_async(dispatch_get_main_queue(), ^{
-            if (self->_finishBlock) self->_finishBlock(self->_fileStream,nil);
-            [self sendNotionWithKey:CWUploadTaskExeEnd userInfo:@{@"fileStream":self->_fileStream}];
-        });
-        [self deallocSession];
-    });
-     */
-}
-
-- (void)taskResume{
-    
-    _isSuspendedState = NO;
-    if (self.uploadManager.uploadingTasks.allValues.count >= self.uploadManager.uploadMaxNum) { // 超过最大限制数量3个
-        
-        self.fileStream.fileStatus = CWUploadStatusWaiting;
-        [self archTaskFileStream];
-        HLog(@"状态修改——--文件名:%@ 已上传完进度:%.2f 上传状态:%ld", self.fileStream.fileName, self.fileStream.progressRate, self.fileStream.fileStatus);
-        
-        dispatch_async(dispatch_get_main_queue(), ^{
-            if (self->_successBlock)  self->_successBlock(self->_fileStream);
-            [self sendNotionWithKey:CWUploadTaskExeSuspend userInfo:@{@"fileStream":self->_fileStream}];
-        });
-        return;
-    }else {
-        
-        self.fileStream.fileStatus = CWUploadStatusUpdownloading;
-        [self archTaskFileStream];
-        HLog(@"状态修改——--文件名:%@ 已上传完进度:%.2f 上传状态:%ld", self.fileStream.fileName, self.fileStream.progressRate, self.fileStream.fileStatus);
-        
-        dispatch_async(dispatch_get_main_queue(), ^{
-            if (self->_successBlock)  self->_successBlock(self->_fileStream);
-            [self sendNotionWithKey:CWUploadTaskExeing userInfo:@{@"fileStream":self->_fileStream}];
-        });
-        
-        [self getFileInfo]; // 启动上传任务 先get 后post
-    }
-    
-}
-
-- (void)taskCancel{
-    
-    _fileStream.fileStatus = CWUploadStatusPaused;
-    [self archTaskFileStream];
-    _isSuspendedState = YES;
-    
-    dispatch_async(dispatch_get_main_queue(), ^{
-        if (self->_finishBlock) self->_finishBlock(self->_fileStream,nil);
-        [self sendNotionWithKey:CWUploadTaskExeSuspend userInfo:@{@"fileStream":self->_fileStream}];
-    });
-}
-
-- (void)deallocSession{
-    _taskRepeatNum = 0;
-}
-
-#pragma mark -- tools
-
-- (void)archTaskFileStream{
-    
-    NSArray *fileArray = [self->_fileStream.filePath pathComponents];
-    NSString *filePathAccount = @"0";
-    if (fileArray.count > 3) {
-        filePathAccount = fileArray[fileArray.count - 3];
-    }
-    
-    NSArray *plistArray = [[CWFileUploadManager shardUploadManager].plistPath pathComponents];
-    NSString *plistPathAccount = @"1";
-    if (plistArray.count > 3) {
-        plistPathAccount = plistArray[plistArray.count - 3];
-    }
-    
-//    HLog(@"文件缓存账号:%@ 与 plist文件账号:%@", filePathAccount, plistPathAccount);
-    if (![filePathAccount isEqualToString:plistPathAccount]) {
-//        HLog(@"切换账号 文件缓存账号%@ 与 plist文件账号:%@ 不一致", filePathAccount, plistPathAccount);
-        return;
-    }
-    
-    NSMutableDictionary *fsDic = [CWUploadTask unArcherThePlist:[CWFileUploadManager shardUploadManager].plistPath];
-    if (!fsDic) {
-        fsDic = [NSMutableDictionary dictionary];
-    }
-    [fsDic setObject:_fileStream forKey:_fileStream.fileName];
-    [CWUploadTask archerTheDictionary:fsDic file:[CWFileUploadManager shardUploadManager].plistPath];
-}
-
-
-//归档
-+ (void)archerTheDictionary:(NSDictionary *)dict file:(NSString *)path{
-    
-    NSData *data = [NSKeyedArchiver archivedDataWithRootObject:dict];
-    BOOL finish = [data writeToFile:path atomically:YES];
-    if (finish) {};
-    
-}
-
-//解档
-+ (NSMutableDictionary *)unArcherThePlist:(NSString *)path{
-    NSMutableDictionary *dic = [NSKeyedUnarchiver unarchiveObjectWithFile:path];
-    return dic;
-}
-
-- (void)sendNotionWithKey:(NSString *)key userInfo:(NSDictionary *)dict{
-    //创建通知
-    NSNotification *notification =[NSNotification notificationWithName:key object:nil userInfo:dict];
-    //通过通知中心发送通知
-    [[NSNotificationCenter defaultCenter] postNotification:notification];
-    
-}
-
-@end