private static ZipArchive CreateZipArchive(string destFile, bool createNew) { AbstractFile zipFile = new DiskFile(destFile); if (createNew) { // In order to create a new zip file, all we have to do is make sure // that file does not exist before creating our ZipArchive. if (zipFile.Exists) { zipFile.Delete(); } } else { if (!zipFile.Exists) { throw new ArgumentException(destFile + " is not exist!"); } } return(CreateZipArchive(zipFile)); }
private static ZipArchive CreateZipArchive(string destFile, bool createNew) { AbstractFile zipFile = new DiskFile(destFile); if (createNew) { // In order to create a new zip file, all we have to do is make sure // that file does not exist before creating our ZipArchive. if (zipFile.Exists) { zipFile.Delete(); } } else { if (!zipFile.Exists) { throw new ArgumentException(destFile + " is not exist!"); } } return CreateZipArchive(zipFile); }