Ejemplo n.º 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);
            }
        }
Ejemplo n.º 2
0
 public void DeleteDirectoryContents(string dir)
 {
     DirectoryUtils.DeleteDirectoryContents(dir);
 }