public IEnumerable<string> Browse(string containerLocation, IBrowserFilter filter = null)
        {
            if (containerLocation == null)
            {
                throw new ArgumentException("containerLocation is null");
            }

            return Directory.GetFiles(containerLocation, filter == null ? "*.*" : filter.Pattern, SearchOption.AllDirectories);
        }
Пример #2
0
        public IEnumerable<string> Browse(string containerLocation, IBrowserFilter filter = null)
        {
            if (containerLocation == null)
            {
                throw new ArgumentException("containerLocation is null");
            }

            if (filter != null)
            {
                return File.ReadAllLines(containerLocation, Encoding.GetEncoding(filter.Pattern));
            }

            return File.ReadAllLines(containerLocation);
        }
Пример #3
0
 internal virtual IEnumerable<string> GetFiles(string path, IContainerBrowser directoryRecursiveBrowser, IBrowserFilter filter = null)
 {
     return directoryRecursiveBrowser.Browse(path, filter);
 }
Пример #4
0
 public TextFilesProcessor(IStringParser stringParser, IContainerBrowser directoryRecursiveBrowser, IContainerBrowser fileLinesBrowser, IBrowserFilter directoryRecursiveBrowserFilter = null, IBrowserFilter fileLinesBrowserFilter = null)
     : this(stringParser, directoryRecursiveBrowser, fileLinesBrowser, directoryRecursiveBrowserFilter)
 {
     _fileLinesBrowserFilter = fileLinesBrowserFilter;
 }