Blacker.Scraper.DownloadFormats.CBZDownloadFormat.SaveDownloadedChapter C# (CSharp) Method

SaveDownloadedChapter() public method

public SaveDownloadedChapter ( IChapterRecord chapter, DirectoryInfo downloadedFiles, string outputFolder, string &path ) : void
chapter IChapterRecord
downloadedFiles System.IO.DirectoryInfo
outputFolder string
path string
return void
        public void SaveDownloadedChapter(IChapterRecord chapter, DirectoryInfo downloadedFiles, string outputFolder, out string path)
        {
            if (chapter == null)
                throw new ArgumentNullException("chapter");
            if (downloadedFiles == null)
                throw new ArgumentNullException("downloadedFiles");
            if (String.IsNullOrEmpty(outputFolder))
                throw new ArgumentException("Output path must not be null or empty.", "outputFolder");

            path = Path.Combine(outputFolder, GetNameForSave(chapter) + ".cbz");

            var fileInfo = new FileInfo(path);

            using (var zip = new ZipFile())
            {
                zip.AddDirectory(downloadedFiles.FullName, null);
                zip.Save(fileInfo.FullName);
            }
        }
CBZDownloadFormat