public void CopyFileToDirectory(string filenameString, string workingDirectory, bool replace) { var filePath = XIO.AbsoluteFilePath(filenameString); var directoryPath = XIO.DirectoryPath(workingDirectory); var destinationFilePath = Combine(directoryPath, XIO.RelativeFilePath(filePath.Filename.Value)); System.IO.File.Copy(filePath.Value, destinationFilePath.Value, replace); }
public DirectoryPath CreateTemporaryDirectoryPath() { var path = GetTemporaryDirectoryPath(); var result = Combine(path, XIO.DirectoryPath(Guid.NewGuid().ToString("N"))); if (!System.IO.Directory.Exists(result.Value)) { System.IO.Directory.CreateDirectory(result.Value); } return(result); }
public void CopyFiles(DirectoryPath sourceDir, DirectoryPath targetDir) { Directory.CreateDirectory(targetDir.Value); foreach (var file in Directory.GetFiles(sourceDir.Value)) { File.Copy(file, System.IO.Path.Combine(targetDir.Value, System.IO.Path.GetFileName(file))); } foreach (var directory in Directory.GetDirectories(sourceDir.Value)) { CopyFiles(XIO.DirectoryPath(directory), XIO.DirectoryPath(System.IO.Path.Combine(targetDir.Value, System.IO.Path.GetFileName(directory)))); } }
public DirectoryPath GetEntryAssemblyLocalPath() { var entryAssembly = Assembly.GetEntryAssembly(); if (entryAssembly == null) { return(null); } var codeBase = entryAssembly.CodeBase; var localPath = new Uri(codeBase).LocalPath; var index = localPath.LastIndexOf('\\'); localPath = localPath.Substring(0, index); return(XIO.DirectoryPath(localPath)); }
public static WebApiDeployment ReadSetup(AbsoluteFilePath setupFile) { var webServers = new List <WebServerDeployment> { new WebServerDeployment() { Name = "Platform", Type = "platform", Port = "5050", Server = "localhost", ProjectTemplate = "E01D.Nodal.Web", }, new WebServerDeployment() { Name = "Security", Type = "security", Port = "5051", Server = "localhost", ProjectTemplate = "E01D.Nodal.Web" }, new WebServerDeployment() { Name = "Ioc", Type = "app", Port = "5052", Server = "localhost", ProjectTemplate = "E01D.Nodal.Web" } }; return(new WebApiDeployment() { SolutionFolder = XIO.DirectoryPath(@"C:\Dev\VSO\EvolvingGit\Site\src"), WebServers = webServers }); }
public DirectoryPath CombineDirectory(DirectoryPath solutionPath, string relativePath) { solutionPath = EnsureTerminalDirectorySeperator(solutionPath); return(XIO.DirectoryPath(solutionPath.Value += relativePath + @"\")); }