/// <summary> /// Copies a file from a source path to destination path /// </summary> public void CopyFile() { if (IsSourcePathRelative != null && IsSourcePathRelative.ToUpper() == Constants.YES) { SourceFile = Environment.CurrentDirectory + @"\FitNesseRoot\" + SourceFile; } if (!File.Exists(SourceFile)) { throw new ApplicationException(string.Format("Source file {0} does not exist!", SourceFile)); } File.Copy(SourceFile, DestinationFile, true); if (!File.Exists(DestinationFile)) { throw new ApplicationException(string.Format("Unable to copy file {0}!", SourceFile)); } }
/// <summary> /// Unzips a compressed file /// </summary> public void UnzipFile() { if (IsSourcePathRelative != null && IsSourcePathRelative.ToUpper() == Constants.YES) { SourceFile = Environment.CurrentDirectory + @"\FitNesseRoot\" + SourceFile; } if (!File.Exists(SourceFile)) { throw new ApplicationException(string.Format("Source file {0} does not exist!", SourceFile)); } if (!SourceFile.EndsWith(".zip") && !SourceFile.EndsWith(".gz")) { throw new ApplicationException("SourceFile is not of the right file type. Can only uncompress .zip or .gz files"); } //CompressionLib compressionLib = new CompressionLib(); //compressionLib.Extract(SourceFile, NewDirectoryName); }