public async Task <bool> ExistsAsync(string relativeLocation) { var key = _locationTemplateParser.SetBase(relativeLocation, string.Empty).TrimStart('/'); _logger.LogInformation($"Does exist file: '{key}' on '{_options.BucketName}' bucket"); var response = await _amazonS3Client.GetObjectAsync(_options.BucketName, key); return(response.Key != null); }
public Task <bool> ExistsAsync(string relativeLocation) { var fullPath = _locationTemplateParser.SetBase(relativeLocation, _options.BasePath); using (var client = new SftpClient(_options.HostName, _options.Port, _options.UserName, _options.Password)) { client.Connect(); return(Task.FromResult(client.Exists(fullPath))); } }
// TODO tests public string GetUrl(string relativeLocation) { return(_locationTemplateParser.SetBase(relativeLocation, _options.CdnUrl)); }