protected void SetupConfigFromTemplate(string pathToConfig, string pathToTemplate) { if (LocalFileSystem.FileExists(pathToTemplate)) { if (!TargetFileSystem.FileExists(pathToConfig)) { Logger.Instance.Log(LogLevel.Info, "\tCreating config '{0}' from '{1}' template", TargetFileSystem.GetFullPath(pathToConfig), LocalFileSystem.GetFullPath(pathToTemplate)); LocalFileSystem.CopyFile(pathToTemplate, TargetFileSystem, pathToConfig, true); } EnvironmentHelper.ExpandEnvironmentVariablesInConfig(pathToConfig, TargetFileSystem); } }
public void CopyFileTest() { var FoundFiles = LocalFileSystem.FindFiles("/Mounted/DirectoryOnMountedFileSystem", "*.dat"); var SourcePath = "/Mounted/DirectoryOnMountedFileSystem/1.txt"; var DestinationPath = "/Mounted/DirectoryOnMountedFileSystem/10.bin"; try { LocalFileSystem.DeleteFile(DestinationPath); } catch { } LocalFileSystem.CopyFile(SourcePath, DestinationPath); Assert.AreEqual( LocalFileSystem.GetFileInfo(SourcePath).Size, LocalFileSystem.GetFileInfo(DestinationPath).Size ); LocalFileSystem.DeleteFile(DestinationPath); }