//根据导入列表下载
public void DownLoadFile(List <string> pathList, string outFamate)
{
FolderBrowserDialog fbd = new FolderBrowserDialog();
fbd.ShowNewFolderButton = true;
fbd.Description = "请选择一个文件夹存放导出的视频文件。";
//选择保存文件夹
if (fbd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
worker.DoWork += new DoWorkEventHandler(DoDownLoadWork);
worker.ProgressChanged += new ProgressChangedEventHandler(ProgessChanged);
worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(CompleteDownLoadWork);
List <FileStatus> fileList = new List <FileStatus>();
FSClient fs = new FSClient();
List <string> noFound = new List <string>();
foreach (string filePath in pathList)
{
FileStatus myfile = fs.GetFileStatus(ConfigHelper.HdfsRoot + "/" + CurrentPath + "/" + filePath + outFamate);
if (myfile != null)
{
fileList.Add(myfile);
}
else
{
noFound.Add(filePath);
}
}
string nofoundTitle = string.Format("以下{0}个文件没有找到,请核实:\r\n{1}\r\n===结束===", noFound.Count, string.Join("\r\n", noFound.ToArray()));
File.WriteAllText(fbd.SelectedPath + "/NoFound.txt", nofoundTitle);
worker.RunWorkerAsync(new DownloadArg()
{
FileList = fileList, SavePath = fbd.SelectedPath, OutFileType = 0
});
}
}