Amazon.KinesisTap.AutoUpdate/UpdateUtility.cs
/// <summary>
/// Create a downloader according to the url
/// </summary>
/// <param name="url">Could be https://, s3:// or file:// urls</param>
/// <param name="context">Standard plugin context used by KinesisTap plugins</param>
/// <returns>One of the File Downloaders</returns>
Create a downloader according to the url
Create a downloader according to the url
public static IFileDownloader CreateDownloaderFromUrl(string url, IPlugInContext context)
        {
            if (Uri.TryCreate(url, UriKind.Absolute, out Uri uri))
            {
                switch (uri.Scheme)
                {
                    case "https":
                        return new HttpDownloader();
                    case "file":
                        return new FileDownloader();
                    case "s3":
                        return new S3Downloader(context);
                    default:
                        throw new InvalidOperationException("Invalid PackageVersion. Only https://, file:// and s3// are supported");
                }
            }
            else
            {
                throw new InvalidOperationException("PackageVersion is not a valid Url");
            }
        }
public static IFileDownloader CreateDownloaderFromUrl ( string url , IPlugInContext context ) { if ( Uri . TryCreate ( url , UriKind . Absolute , out Uri uri ) ) { switch ( uri . Scheme ) { case " " : return new HttpDownloader ( ) ; case " " : return new FileDownloader ( ) ; case " " : return new S3Downloader ( context ) ; default : throw new InvalidOperationException ( " " ) ; } } else { throw new InvalidOperationException ( " " ) ; } }
Create a downloader according to the url
Create a downloader according to the url
One of the File Downloaders
One of the File Downloaders
url
string
Could be https://, s3:// or file:// urls
Could be https : // s3 : // or file : // urls
context
IPlugInContext
Standard plugin context used by KinesisTap plugins
Standard plugin context used by KinesisTap plugins