Exemplo n.º 1
0
 public IEnumerable <IReadWriteFileResource> ListResourcesRecursive()
 {
     return(_progressReporter.Bookend(
                $"Listing resources under {BasePath}",
                () => ListResourcesUnder(
                    BasePath,
                    new ListOptions()
                    )
                .ToArray()
                ));
 }
        public void RemoveStaleFiles(IFileSystem source, IFileSystem target)
        {
            var sourcePaths = source.ListResourcesRecursive()
                              .Select(o => o.RelativePath)
                              .AsHashSet();

            target.ListResourcesRecursive()
            .Where(o => !sourcePaths.Contains(o.RelativePath))
            .ForEach(o =>
            {
                _progressReporter.Bookend(
                    $"Remove target: {o.RelativePath}",
                    () => target.Delete(o.RelativePath)
                    );
            });
        }