Esempio n. 1
0
        public DirectoryStructure Build(string path)
        {
            var dir      = new DirectoryEx(_rootPath);
            var rootMeta = new Meta();

            if (dir.TryGetFile(_dirrcFileName, out var rootdirrc))
            {
                rootMeta = rootdirrc !.GetFromJson <Meta>();
            }
            var meta = rootMeta;

            foreach (var item in dir.WalkDown(path))
            {
                if (item.TryGetFile(_dirrcFileName, out var dirrc))
                {
                    var subMeta = dirrc !.GetFromJson <Meta>();
                    meta = meta.Merge(subMeta, item);
                }
            }

            return(null);// this.Crawl(null, startPath, path);
        }
Esempio n. 2
0
 public FileEx(DirectoryEx parent, string name)
 {
     this.parent = parent;
     Name        = name;
     this.path   = System.IO.Path.Combine(parent.FullPath, name);
 }