Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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)));
            }
        }
Ejemplo n.º 3
0
 // TODO tests
 public string GetUrl(string relativeLocation)
 {
     return(_locationTemplateParser.SetBase(relativeLocation, _options.CdnUrl));
 }