private string GetHashForDirectory(string fullPath) { var subPath = _activeRackServices.GetSubpath(fullPath); string rackHash = _activeRackServices.ActiveRackHash; string universalSubPath = CreateUniversalPath(subPath); string hash = _hasher.ComputeStringHash($"{rackHash}.{universalSubPath}"); return(hash); }
public DirectoryInfoDto GetSubDirectoryInfo(string subDirectory) { var directoryInfo = new DirectoryInfoDto(); var activeDirectory = _activeRackService.ActiveDirectory; var fullPath = Path.Combine(activeDirectory, subDirectory); var fileNames = _directoryMethods.GetFileNames(fullPath).Select(Path.GetFileName); var dirNames = _directoryMethods.GetDirectories(fullPath).Select(path => _activeRackService.GetSubpath(path)); var normSubDir = _activeRackService.GetSubpath(fullPath); if (normSubDir != ".") { dirNames = new[] { Path.Combine(normSubDir, @"..") } }
public IEnumerable <Content> ParsePhysicalFiles(DirectoryContentThreadInfo info) { info.FileNames = _directoryMethods.GetFileNames(info.FullPath); foreach (var fn in info.FileNames) { info.FilesDone++; PhysicalFile physicalFile = new() { Hash = _hasher.ComputeFileContentHash(fn), Type = PhysicalFile.GetContentTypeByExtension(fn), FullPath = fn, SubPath = _activeRackService.GetSubpath(fn) }; yield return(ToContentEntity(physicalFile)); } }