Exemple #1
0
        private FileContent BuildItemFromAttr(FileAccessAttribute attribute)
        {
            var root = GetRoot(attribute);
            var path = Path.Combine(root, attribute.FileName);

            if (!System.IO.File.Exists(path))
            {
                return(null);
            }
            var contents = System.IO.File.ReadAllText(path);

            return(new FileContent
            {
                FileName = attribute.FileName,
                Content = contents
            });
        }
Exemple #2
0
        private IAsyncCollector <FileContent> BuildCollector(FileAccessAttribute attribute)
        {
            var root = GetRoot(attribute);

            return(new FileAccessAsyncCollector(root));
        }
Exemple #3
0
        private string GetRoot(FileAccessAttribute attribute)
        {
            var root = attribute.Folder ?? this.Root ?? Path.GetTempPath();

            return(root);
        }