public void ExtractFolder(string extractionPath, IVirtualFolder folder) { var saveService = new VirtualFileSaveService(); var extractor = new VirtualFileExtractionService(); var thisFolderPath = saveService.SaveFolder(extractionPath, folder.Name); foreach (var file in folder.Files) { WriteToConsole(Color.LightBlue, "Extracting " + file.Name); var fileData = extractor.GetDataForVirtualFile(file); var savefileType = file.FileData.Type; if (file.FileData.Type == FileType.Zap) { fileData = ConversionService.ConvertFromZapToJpg(fileData); savefileType = FileType.Jpg; } saveService.SaveFile(thisFolderPath, file.Name, savefileType, fileData); } foreach (var subFolder in folder.SubFolders) { ExtractFolder(thisFolderPath, subFolder); } }
public void ExtractFiles(string extractionPath, List <IVirtualFileEntry> files) { var saveService = new VirtualFileSaveService(); var extractor = new VirtualFileExtractionService(); foreach (var file in files) { WriteToConsole(Color.LightBlue, "Extracting " + file.Name); var fileData = extractor.GetDataForVirtualFile(file); var savefileType = file.FileData.Type; if (file.FileData.Type == FileType.Zap) { fileData = ConversionService.ConvertFromZapToJpg(fileData); savefileType = FileType.Jpg; } saveService.SaveFile(extractionPath, file.Name, savefileType, fileData); } }