Example #1
0
        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);
        }
Example #2
0
        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);
        }
Example #3
0
        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))));
            }
        }
Example #4
0
        public AbsoluteFilePath[] GetFiles(DirectoryPath directory)
        {
            System.IO.DirectoryInfo directoryInfo = new System.IO.DirectoryInfo(directory.Value);

            var fileInfos = directoryInfo.GetFiles();

            AbsoluteFilePath[] files = new AbsoluteFilePath[fileInfos.Length];

            for (int i = 0; i < fileInfos.Length; i++)
            {
                files[i] = XIO.AbsoluteFilePath(fileInfos[i]);
            }

            return(files);
        }
Example #5
0
        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));
        }
Example #6
0
        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
            });
        }
Example #7
0
        public static bool Exists(this AbsoluteFilePath path)

        {
            return(XIO.FileExists(path));
        }
Example #8
0
        public DirectoryPath CombineDirectory(DirectoryPath solutionPath, string relativePath)
        {
            solutionPath = EnsureTerminalDirectorySeperator(solutionPath);

            return(XIO.DirectoryPath(solutionPath.Value += relativePath + @"\"));
        }