private void UnzipFiles(CommandLineLogger logger, string holderFolder, string defaultDirectory, string parentZipFile, string toExtract, ref ParserVersionEnum version) { ZipUtility zp = new ZipUtility(logger) { CaseName = holderFolder, ParentZipFilePath = parentZipFile }; IEnumerable <ExtractFileInfo> htmlFiles = zp.ExtractZip(defaultDirectory, toExtract, ".html"); if (htmlFiles.Any()) { foreach (ExtractFileInfo file in htmlFiles) { File.Copy(file.File_Path, Path.GetDirectoryName(file.File_Path) + "\\save-" + file.File_Name); _filesToPreserve.Add(file); } _htmlToParse.AddRange(htmlFiles.Where(x => !x.File_Name.ToUpper().Trim().StartsWith("INDEX.") && !x.File_Name.ToUpper().Trim().StartsWith("PRESERVATION"))); IEnumerable <ExtractFileInfo> generatedHtmlFiles = zp.GenerateParsedHtml(htmlFiles); if (generatedHtmlFiles.Any()) { version = ParserVersionEnum.Two; foreach (ExtractFileInfo generatedHtmlFile in generatedHtmlFiles) { if (!_htmlToParse.Any(x => x.File_Path.Equals(generatedHtmlFile.File_Path)) && !_htmlToParse.Any(x => x.File_Path.Equals(generatedHtmlFile.File_Path + @"\" + Path.GetFileNameWithoutExtension(generatedHtmlFile.File_Path)))) { _htmlToParse.Add(generatedHtmlFile); } } _tempFilesToRemove.AddRange(generatedHtmlFiles); } else { _htmlToParse.AddRange(htmlFiles.Where(x => x.File_Name.ToUpper().Trim().StartsWith("INDEX."))); } SaveFiles(htmlFiles); } IEnumerable <ExtractFileInfo> zipFiles = zp.ExtractZip(defaultDirectory, toExtract, ".zip"); if (zipFiles.Count() > 0) { SaveFiles(zipFiles); _tempFilesToRemove.AddRange(zipFiles); } IEnumerable <ExtractFileInfo> otherFiles = zp.ExtractZip(defaultDirectory, toExtract, ""); if (otherFiles.Count() > 0) { SaveFiles(otherFiles); } foreach (ExtractFileInfo z in zipFiles) { UnzipFiles(logger, holderFolder, defaultDirectory, toExtract, z.File_Path, ref version); } }