Esempio n. 1
0
        public static void MakeTree(SftpFileTree cur, string remote_path_dir)
        {
            cur.children.Clear();

            SftpFile[] files = SSHController.PullListInDirectory(remote_path_dir);
            for (int i = 0; i < files.Length; i++)
            {
                if (files[i].Name == ".")
                {
                    continue;
                }

                SftpFileTree child = new SftpFileTree(files[i]);

                cur.children.Add(child);
                child.parent = cur;

                if (files[i].IsDirectory)
                {
                    if (files[i].Name == "..")
                    {
                        if (cur.parent != null)
                        {
                            child.children = cur.parent.children;
                        }
                    }
                    else
                    {
                        MakeTree(child, files[i].FullName);
                    }
                }
            }
        }
Esempio n. 2
0
        public static SftpFileTree GetListConfigFile()
        {
            string remote_directory = LoadEnvCoHome();

            if (remote_directory == null)
            {
                return(null);
            }

            string remote_path_dir = remote_directory + add_path_config_dir + ServerList.selected_serverinfo_textblock.serverinfo.id + "/";

            SftpFileTree.MakeTree(SftpFileTree.root, remote_path_dir);
            return(SftpFileTree.root);
        }
Esempio n. 3
0
 private SftpFileTree()
 {
     parent = this;
 }