/// <summary> /// Initializes a new <see cref="HttpFileSystemBasedFindPackageByIdResource" /> class. /// </summary> /// <param name="baseUris">Base URI's.</param> /// <param name="httpSource">An HTTP source.</param> /// <exception cref="ArgumentNullException">Thrown if <paramref name="baseUris" /> is <c>null</c>.</exception> /// <exception cref="ArgumentException">Thrown if <paramref name="baseUris" /> is empty.</exception> /// <exception cref="ArgumentNullException">Thrown if <paramref name="httpSource" /> is <c>null</c>.</exception> public HttpFileSystemBasedFindPackageByIdResource( IReadOnlyList <Uri> baseUris, HttpSource httpSource) { if (baseUris == null) { throw new ArgumentNullException(nameof(baseUris)); } if (baseUris.Count < 1) { throw new ArgumentException(Strings.OneOrMoreUrisMustBeSpecified, nameof(baseUris)); } if (httpSource == null) { throw new ArgumentNullException(nameof(httpSource)); } _baseUris = baseUris .Take(MaxRetries) .Select(uri => uri.OriginalString.EndsWith("/", StringComparison.Ordinal) ? uri : new Uri(uri.OriginalString + "/")) .ToList(); _httpSource = httpSource; _nupkgDownloader = new FindPackagesByIdNupkgDownloader(httpSource); }
internal HttpFileSystemBasedFindPackageByIdResource( IReadOnlyList <Uri> baseUris, HttpSource httpSource, IEnvironmentVariableReader environmentVariableReader) { if (baseUris == null) { throw new ArgumentNullException(nameof(baseUris)); } if (baseUris.Count < 1) { throw new ArgumentException(Strings.OneOrMoreUrisMustBeSpecified, nameof(baseUris)); } if (httpSource == null) { throw new ArgumentNullException(nameof(httpSource)); } _baseUris = baseUris .Take(DefaultMaxRetries) .Select(uri => uri.OriginalString.EndsWith("/", StringComparison.Ordinal) ? uri : new Uri(uri.OriginalString + "/")) .ToList(); _httpSource = httpSource; _nupkgDownloader = new FindPackagesByIdNupkgDownloader(httpSource); _enhancedHttpRetryHelper = new EnhancedHttpRetryHelper(environmentVariableReader); _maxRetries = _enhancedHttpRetryHelper.IsEnabled ? _enhancedHttpRetryHelper.RetryCount : DefaultMaxRetries; }
public RemoteV2FindPackageByIdResource(PackageSource packageSource, HttpSource httpSource) { _baseUri = packageSource.Source.EndsWith("/") ? packageSource.Source : (packageSource.Source + "/"); _httpSource = httpSource; _nupkgDownloader = new FindPackagesByIdNupkgDownloader(_httpSource); PackageSource = packageSource; }
/// <summary> /// Initializes a new <see cref="RemoteV3FindPackageByIdResource" /> class. /// </summary> /// <param name="sourceRepository">A source repository.</param> /// <param name="httpSource">An HTTP source.</param> /// <exception cref="ArgumentNullException">Thrown if <paramref name="sourceRepository" /> /// is <c>null</c>.</exception> /// <exception cref="ArgumentNullException">Thrown if <paramref name="httpSource" /> /// is <c>null</c>.</exception> public RemoteV3FindPackageByIdResource(SourceRepository sourceRepository, HttpSource httpSource) { if (sourceRepository == null) { throw new ArgumentNullException(nameof(sourceRepository)); } if (httpSource == null) { throw new ArgumentNullException(nameof(httpSource)); } SourceRepository = sourceRepository; _httpSource = httpSource; _nupkgDownloader = new FindPackagesByIdNupkgDownloader(httpSource); }
/// <summary> /// Initializes a new <see cref="RemoteV2FindPackageByIdResource" /> class. /// </summary> /// <param name="packageSource">A package source.</param> /// <param name="httpSource">An HTTP source.</param> /// <exception cref="ArgumentNullException">Thrown if <paramref name="packageSource" /> /// is <c>null</c>.</exception> /// <exception cref="ArgumentNullException">Thrown if <paramref name="httpSource" /> /// is <c>null</c>.</exception> public RemoteV2FindPackageByIdResource(PackageSource packageSource, HttpSource httpSource) { if (packageSource == null) { throw new ArgumentNullException(nameof(packageSource)); } if (httpSource == null) { throw new ArgumentNullException(nameof(httpSource)); } _baseUri = packageSource.Source.EndsWith("/") ? packageSource.Source : (packageSource.Source + "/"); _httpSource = httpSource; _nupkgDownloader = new FindPackagesByIdNupkgDownloader(_httpSource); PackageSource = packageSource; }
public RemoteV3FindPackageByIdResource(SourceRepository sourceRepository, HttpSource httpSource) { SourceRepository = sourceRepository; _httpSource = httpSource; _nupkgDownloader = new FindPackagesByIdNupkgDownloader(httpSource); }