Exemplo n.º 1
0
            public FileProvider(IEnumerable <IDocument <Stream> > files, string id)
            {
                if (files is null)
                {
                    throw new ArgumentNullException(nameof(files));
                }
                foreach (var document in files)
                {
                    var dir = Path.Combine(id, Path.GetDirectoryName(document.Id) ?? string.Empty);
                    dir = dir.Replace('\\', '/');
                    if (!this.directoryLookup.ContainsKey(dir))
                    {
                        var value = new StageProviderDirectory(dir);
                        this.directoryLookup.Add(dir, value);
                        this.fileLookup.Add(dir, value);
                    }

                    var directory = this.directoryLookup[dir];

                    var file = new StageProviderFile(document, id);
                    this.fileLookup.Add(Path.Combine(id, document.Id).Replace('\\', '/'), file);
                    directory.Add(file);
                }
            }
Exemplo n.º 2
0
 internal void Add(StageProviderFile file)
 {
     this.fileList.Add(file);
 }