Esempio n. 1
0
        void FillDir(Auxiliary.Local.RSync.SyncFolder ret)
        {
            string path = ret.GetFullPath(SeparatorChar);

            FtpHelper ftp = GetFtp(path);

            List <Auxiliary.Local.RSync> ls = new List <Auxiliary.Local.RSync>();

            foreach (FtpHelper.Item item in ftp.ListDirectoryExtended())
            {
                if (item.IsDirectory)
                {
                    Auxiliary.Local.RSync.SyncFolder ret2 = new Auxiliary.Local.RSync.SyncFolder(ret)
                    {
                        Name = item.Name,
                    };
                    FillDir(ret2);
                    ret.Folders.Add(ret2);
                }
                else
                {
                    ret.Files.Add(new Auxiliary.Local.RSync.SyncFile(ret)
                    {
                        Name   = item.Name,
                        Length = item.Length,
                    });
                }
            }
        }
Esempio n. 2
0
        public void CreateFolder(Auxiliary.Local.RSync.SyncFolder p)
        {
            string path = PurgePath(p.GetFullPath(Path.DirectorySeparatorChar));

            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
            }
        }
Esempio n. 3
0
        public void DeleteFolder(Auxiliary.Local.RSync.SyncFolder p)
        {
            string path = PurgePath(p.GetFullPath(Path.DirectorySeparatorChar));

            if (Directory.Exists(path))
            {
                Directory.Delete(path, true);
            }
        }
Esempio n. 4
0
        public Auxiliary.Local.RSync.SyncFolder GetTree()
        {
            Auxiliary.Local.RSync.SyncFolder ret = new Auxiliary.Local.RSync.SyncFolder(null)
            {
                Name = RemotePath.FullName
            };
            FillDir(ret);

            return(ret);
        }
Esempio n. 5
0
        void FillDir(Auxiliary.Local.RSync.SyncFolder ret)
        {
            string path = PurgePath(ret.GetFullPath(Path.DirectorySeparatorChar));

            List <Auxiliary.Local.RSync> ls = new List <Auxiliary.Local.RSync>();

            foreach (string file in Directory.GetFiles(path))
            {
                ret.Files.Add(new Auxiliary.Local.RSync.SyncFile(ret)
                {
                    Name   = Path.GetFileName(file),
                    Length = new FileInfo(file).Length,
                });
            }
            foreach (string dir in Directory.GetDirectories(path))
            {
                Auxiliary.Local.RSync.SyncFolder ret2 = new Auxiliary.Local.RSync.SyncFolder(ret)
                {
                    Name = Path.GetFileName(dir),
                };
                FillDir(ret2);
                ret.Folders.Add(ret2);
            }
        }
Esempio n. 6
0
        public void CreateFolder(Auxiliary.Local.RSync.SyncFolder p)
        {
            string path = p.GetFullPath(SeparatorChar);

            GetFtp().CreateDirectory(path);
        }
Esempio n. 7
0
        public void DeleteFolder(Auxiliary.Local.RSync.SyncFolder p)
        {
            string path = p.GetFullPath(SeparatorChar);

            GetFtp().DeleteFile(path);
        }