private string DirectoryContents(string dir, IDirectoryProcessor reader, string root, int port)
        {
            var directoryContents = new StringBuilder();
            var files             = reader.GetFiles(root + dir);

            foreach (var replacedBackSlash in files.Select(file => file.Replace('\\', '/')))
            {
                directoryContents.Append(@"<br><a href=""http://*****:*****@""" >" +
                                         replacedBackSlash.Remove(0, replacedBackSlash.LastIndexOf('/') + 1)
                                         + "</a>");
            }
            var subDirs = reader.GetDirectories(root + dir);

            foreach (var replacedBackSlash in subDirs.Select(subDir => subDir.Replace('\\', '/')))
            {
                directoryContents.Append(@"<br><a href=""http://*****:*****@""" >" +
                                         replacedBackSlash.Remove(0, replacedBackSlash.LastIndexOf('/') + 1)
                                         + "</a>");
            }
            return(HtmlHeader() + directoryContents + HtmlTail());
        }
 public PeriodicalHandler(
     ILog log,
     IDirectoryProcessor directoryProcessor) :
     base(nameof(PeriodicalHandler), (int)TimeSpan.FromMinutes(1).TotalMilliseconds, log)
 {
     _log = log;
     _directoryProcessor = directoryProcessor;
 }
 public MainPeriodicalHandler(
     ILog log,
     IDirectoryProcessor directoryProcessor,
     string diskPath,
     int workersMaxCount,
     int workersMinCount)
     : base(nameof(MainPeriodicalHandler), (int)TimeSpan.FromMinutes(1).TotalMilliseconds, log)
 {
     _log = log;
     _directoryProcessor = directoryProcessor;
     _diskPath           = diskPath;
     _workersMaxCount    = workersMaxCount <= 0 ? 8 : workersMaxCount;
     _workersMinCount    = workersMinCount <= 0 ? 2 : workersMinCount;
     _workersCount       = (_workersMaxCount + _workersMinCount) / 2;
     Directory.SetCurrentDirectory(_diskPath);
 }
Beispiel #4
0
 public Processor(IPostFinder postFinder, IDirectoryProcessor directoryProcessor)
 {
     this.postFinder         = postFinder;
     this.directoryProcessor = directoryProcessor;
 }
Beispiel #5
0
		public ProjectProcessor(IDirectoryProcessor directoryProcessor,Func<IModuleReadmeGenerator> moduleGenerator)
		{
			this.directoryProcessor = directoryProcessor;
			this.moduleGenerator = moduleGenerator;
		}