private FilesystemStatNode BuildFileTree(string path)
        {
            var node  = new FilesystemStatNode(path);
            var dirs  = SafeGetDirectories(path);
            var files = SafeGetFiles(path);

            foreach (var file in files)
            {
                var newNode = new FilesystemStatNode(file.FullName);
                newNode.Size = file.Length;
                node.AddNode(newNode);
            }

            foreach (var dir in dirs)
            {
                var newDirNode = BuildFileTree(dir.FullName);
                node.AddNode(newDirNode);
            }

            return(node);
        }
        private FilesystemStatNode BuildFolderTree(string path)
        {
            var node = new FilesystemStatNode(path);
            var dirs = SafeGetDirectories(path);

            if (dirs.Count() == 0)
            {
                node.Size = SafeGetFiles(path).Sum(f => f.Length);
            }

            foreach (var dir in dirs)
            {
                var newNode = BuildFolderTree(dir.FullName);
                node.AddNode(newNode);
            }

            return(node);
        }