@@ -204,22 +204,25 @@ public void Zip(DirectoryPath rootPath, FilePath outputPath, IEnumerable<FilePat
204204 /// <param name="zipPath">Zip file path.</param>
205205 /// <param name="outputPath">Output directory path.</param>
206206 public void Unzip ( FilePath zipPath , DirectoryPath outputPath )
207+ => Unzip ( zipPath , outputPath , false ) ;
208+
209+ /// <summary>
210+ /// Unzips the specified file to the specified output path.
211+ /// </summary>
212+ /// <param name="zipPath">Zip file path.</param>
213+ /// <param name="outputPath">Output directory path.</param>
214+ /// <param name="overwriteFiles">Flag for if files should be overwritten in output.</param>
215+ public void Unzip ( FilePath zipPath , DirectoryPath outputPath , bool overwriteFiles )
207216 {
208- if ( zipPath == null )
209- {
210- throw new ArgumentNullException ( nameof ( zipPath ) ) ;
211- }
212- if ( outputPath == null )
213- {
214- throw new ArgumentNullException ( nameof ( outputPath ) ) ;
215- }
217+ ArgumentNullException . ThrowIfNull ( zipPath ) ;
218+ ArgumentNullException . ThrowIfNull ( outputPath ) ;
216219
217220 // Make root path and output file path absolute.
218221 zipPath = zipPath . MakeAbsolute ( _environment ) ;
219222 outputPath = outputPath . MakeAbsolute ( _environment ) ;
220223
221- _log . Verbose ( "Unzipping file {0} to {1}" , zipPath . FullPath , outputPath . FullPath ) ;
222- ZipFile . ExtractToDirectory ( zipPath . FullPath , outputPath . FullPath ) ;
224+ _log . Verbose ( "Unzipping file {0} to {1} (overwrite files: {2}) " , zipPath . FullPath , outputPath . FullPath , overwriteFiles ) ;
225+ ZipFile . ExtractToDirectory ( zipPath . FullPath , outputPath . FullPath , overwriteFiles ) ;
223226 }
224227
225228 private string GetRelativePath ( DirectoryPath root , Path path )
0 commit comments