Example #1
0
        public void Copy(string from, string to, IEnumerable <string> excludes, IEnumerable <string> includes, bool deleteToDirectory)
        {
            if (DirectoryUtils.DirectoryExists(from))
            {
                if (deleteToDirectory)
                {
                    DirectoryUtils.DeleteDirectoryContents(to);
                }
                DirectoryUtils.CopyDirectory(from, to, excludes, includes);
            }
            else
            {
                string dest;

                if (DirectoryUtils.DirectoryExists(to))
                {
                    dest = Path.Combine(to, Path.GetFileName(from));
                }
                else
                {
                    DirectoryUtils.CreateDirectory(Path.GetDirectoryName(to));
                    dest = to;
                }
                FileUtils.CopyFile(from, dest);
            }
        }
Example #2
0
 public void CreateDirectory(string dir)
 {
     DirectoryUtils.CreateDirectory(dir);
 }