Example #1
0
        private async Task <string> DownloadCoreAsync(Uri uri, XRefArchive xa, bool isMajor)
        {
            IXRefContainer container;

            container = await _downloader.DownloadAsync(uri);

            if (!(container is XRefMap map))
            {
                // not support download an xref archive, or reference to an xref archive
                return(null);
            }
            if (map.Redirections?.Count > 0)
            {
                await RewriteRedirections(uri, xa, map);
            }
            if (map.References?.Count > 0 && map.HrefUpdated != true)
            {
                if (string.IsNullOrEmpty(map.BaseUrl))
                {
                    XRefMapDownloader.UpdateHref(map, uri);
                }
            }
            lock (_syncRoot)
            {
                if (isMajor)
                {
                    return(xa.CreateMajor(map));
                }
                else
                {
                    return(xa.CreateMinor(map, GetNames(uri, map)));
                }
            }
        }
Example #2
0
 public ReaderCreator(ImmutableList <Uri> uris, int maxParallelism, string baseFolder)
 {
     _uris       = uris;
     _downloader = new XRefMapDownloader(baseFolder, maxParallelism);
 }
Example #3
0
 public ReaderCreator(ImmutableList <Uri> uris, int maxParallelism, string baseFolder, IReadOnlyList <string> fallbackFolders)
 {
     _uris       = uris;
     _downloader = new XRefMapDownloader(baseFolder, fallbackFolders, maxParallelism);
 }
Example #4
0
 public ReaderCreator(ImmutableList<Uri> uris, int maxParallelism, string baseFolder)
 {
     _uris = uris;
     _downloader = new XRefMapDownloader(baseFolder, maxParallelism);
 }
Example #5
0
 public ReaderCreator(ImmutableList <Uri> uris, int maxParallelism)
 {
     _uris       = uris;
     _downloader = new XRefMapDownloader(maxParallelism);
 }