public FTPReleaseSide(IFTPClient client, LocalFTPSiteCache localFTPSiteCache, int releaseNumber) { this.client = client; this.client.EnableSSL = String.IsNullOrEmpty(client.Password); this.localFTPSiteCache = localFTPSiteCache; this.releaseNumber = releaseNumber; }
public AddressService(IOptions <AppSettings> appSettings, ILogger <AddressService> logger, IFTPClient ftpClient, IKafkaProducer kafkaProducer) { _appSettings = appSettings.Value; _client = ftpClient; _kafkaProducer = kafkaProducer; _logger = logger; }
public BBRService(IOptions <AppSettings> appSettings, ILogger <BBRService> logger, IKafkaProducer kakfkaProducer, IFTPClient ftpClient) { _appSettings = appSettings.Value; _logger = logger; _client = ftpClient; _producer = kakfkaProducer; }
/// <summary> /// /// </summary> /// <param name="uploader">A FTPclient set with the root as the upload folder for the site in question.</param> /// <returns>The available releases from the external site.</returns> public static IEnumerable <int> GetAvailableReleases(this IFTPClient uploader) { int DO_NOT_USE = -1; return(from a in uploader.ListDirectory() where int.TryParse(a, out DO_NOT_USE) select DO_NOT_USE); }
public void SetUp() { _ftpClient = A.Fake <IFTPClient>(); sut = new SermonUploader(_ftpClient) { FileName = "tbc_sep_29_2018.mp3" }; }
private Tuple <bool, int> getReleaseNumber(IFTPClient client) { var picker = new ReleasePicker(FTPUtilities.GetAvailableReleases(client)); picker.ShowDialog(); return(new Tuple <bool, int>(picker.DialogResult == DialogResult.OK, picker.Result)); }
/// <summary> /// /// </summary> /// <param name="ftpClient">The uploader to use for the transfer. Set to uload to a specific location.</param> /// <remarks></remarks> public ReleaseFTPUploader(IFTPClient ftpClient) { if (ftpClient == null) { throw new ArgumentNullException(nameof(ftpClient)); } this.uploader = ftpClient; }
public FTPClientValidationDecorator(IFTPClient decorated) { if (decorated == null) { throw new ArgumentNullException(nameof(decorated)); } this.decorated = decorated; }
public override ReleaseSide GetInstance() { //TODO: Yeah, this code sucks. //Determine the FTP Server to view. SiteSelection f = new SiteSelection(manifestManager); PopulateData(f); f.ShowDialog(); if (f.DialogResult == DialogResult.Cancel) { return(null); } var manifest = f.Result; IFTPClient client = getFTPClient(manifest, f.PasswordResult); //Determine the release to view from the FTP as comparison. var releaseIDResult = getReleaseNumber(client); if (!releaseIDResult.Item1) { return(null); } int releaseNumber = releaseIDResult.Item2; string ftpFolderLocation = Settings.Default.LocalFTPLocation; string releaseFolderPath = LocalFTPServiceUtilities.GetFolderPathForSite(ftpFolderLocation, manifest.FTPServer); throw new NotImplementedException(); //TODO: localSiteManager should be instantiated with the value of the site here. LocalSiteManager siteManager2 = new LocalSiteManager(null, null); LocalFTPSiteCache cache = new LocalFTPSiteCache(releaseFolderPath, localSiteManager); return(new FTPReleaseSide(client, cache, releaseNumber)); }