Example #1
0
        void LoadTree(string parentPath, Tree tree, IStorageVisitor visitor)
        {
            foreach (var entry in tree)
            {
                if (entry.TargetType == TreeEntryTargetType.Tree)
                {
                    var child = entry.Target as Tree;
                    if (child != null)
                    {
                        if (visitor.ShouldTraverseDirectory(entry.Path))
                        {
                            LoadTree(entry.Path, child, visitor);
                        }
                    }
                }
            }

            visitor.VisitDirectory(parentPath,
                (from entry in tree
                where entry.TargetType == TreeEntryTargetType.Blob
                let blob = entry.Target as Blob
                where blob != null
                select new StoredFile(entry.Path, blob.Sha, () => blob.GetContentStream(new FilteringOptions(entry.Path)))).ToList()
                );
        }