过滤需要下载的文件

- (void)getWillDownFile:(NSString *)videoURL{

if (videoURL.length > 6)

{

NSArray *tempArray = [videoURL componentsSeparatedByString:@"/"];

NSString *getUrl = [NSString stringWithFormat:@"%@",tempArray[tempArray.count - 1]];

NSString *cachesPath =  [ExtensionObject fileExist:@"resource"];

NSString *videoUrl = [NSString stringWithFormat:@"%@/%@",cachesPath,getUrl];

NSFileManager* fileManager = [NSFileManager defaultManager];

//取得一个目录下得所有文件名

NSArray *fileArray = [fileManager subpathsAtPath:cachesPath];

if (![fileArray containsObject:getUrl]) {

[self DownLoad:_DownLoadURL];

}else{

[self playVideo:videoUrl];

}

}

}

你可能感兴趣的:(过滤需要下载的文件)