Ejemplo n.º 1
0
        public override void RegisterRealTasks(PhysicalServer server)
        {
            string to = server.MapPath(_to);

            foreach (var f in _froms)
            {
                var o = new CopyDirectoryTask(f, to, _options, _path);
                server.AddTask(o);
            }
        }
Ejemplo n.º 2
0
        public override void RegisterRealTasks(PhysicalServer server)
        {
            string to = server.MapPath(_to);

            foreach (var f in _froms)
            {
                var o = new CopyDirectoryTask(f, to, _options, _path);
                server.AddTask(o);
            }
        }
Ejemplo n.º 3
0
            public override void Context()
            {
                base.Context();
                Directory.CreateDirectory(base.destDir);
                var destDir = new DirectoryInfo(base.destDir);

                destDir.Attributes = FileAttributes.ReadOnly;

                task = new CopyDirectoryTask(sourceDir, base.destDir, null, DestinationCleanOptions.None, null, new DotNetPath());
            }
Ejemplo n.º 4
0
        public void CopyDirectory()
        {
            var t = new CopyDirectoryTask(_source, _dest, DestinationCleanOptions.None, new DotNetPath());

            t.Execute();

            var s = File.ReadAllText(_path.Combine(_dest, "test.txt"));

            Assert.AreEqual("the test\r\n", s);
        }
Ejemplo n.º 5
0
            public override void Context()
            {
                base.Context();
                Directory.CreateDirectory(destDir);
                var dest = Path.Combine(destDir, "test.txt");

                File.WriteAllLines(dest, new[] { "bad file" });

                task = new CopyDirectoryTask(sourceDir, destDir, null, DestinationCleanOptions.Delete, null, new DotNetPath());
            }
Ejemplo n.º 6
0
            public override void Context()
            {
                base.Context();
                Directory.CreateDirectory(destDir);
                var dest = Path.Combine(destDir, "test.txt");

                File.WriteAllLines(dest, new[] { "bad file" });
                var destFile = new FileInfo(dest);

                destFile.IsReadOnly = true;
                Assert.IsTrue(destFile.IsReadOnly, "Expected the destination file to be readonly");

                task = new CopyDirectoryTask(sourceDir, destDir, null, DestinationCleanOptions.None, null, new DotNetPath());
            }
Ejemplo n.º 7
0
            public override void Context()
            {
                base.Context();

                File.WriteAllLines(Path.Combine(sourceDir, "notcopied.txt"), new[] { "new" });
                Directory.CreateDirectory(destDir);
                var dest = Path.Combine(destDir, "test.txt");

                File.WriteAllLines(dest, new[] { "bad file" });

                IList <Regex> ignoredCopyPatterns = new List <Regex>();

                ignoredCopyPatterns.Add(new Regex("notcopied*"));

                task = new CopyDirectoryTask(sourceDir, destDir, ignoredCopyPatterns, DestinationCleanOptions.Clear, null, new DotNetPath());
            }
Ejemplo n.º 8
0
            public override void Context()
            {
                base.Context();
                Directory.CreateDirectory(destDir);
                string subdirectory = Path.Combine(destDir, "sub");

                Directory.CreateDirectory(subdirectory);
                var dest = Path.Combine(destDir, "test.txt");

                File.WriteAllLines(dest, new[] { "bad file" });
                File.WriteAllLines(Path.Combine(destDir, "notcleared.txt"), new[] { "old" });
                subdirectoryFile = Path.Combine(subdirectory, "app_offline.htm");
                File.WriteAllLines(subdirectoryFile, new[] { "ignored" });

                IList <Regex> clearIgnoredPatterns = new List <Regex>();

                clearIgnoredPatterns.Add(new Regex("notcleared*"));
                clearIgnoredPatterns.Add(new Regex(@"[Aa]pp_[Oo]ffline\.htm"));

                task = new CopyDirectoryTask(sourceDir, destDir, null, DestinationCleanOptions.Clear, clearIgnoredPatterns, new DotNetPath());
            }
Ejemplo n.º 9
0
 public override void Context()
 {
     base.Context();
     Directory.CreateDirectory(destDir);
     task = new CopyDirectoryTask(sourceDir, destDir, null, DestinationCleanOptions.None, null, new DotNetPath());
 }