/// <summary> /// Constructor /// </summary> public AbsContainerSource(string containerName, string keyFile, IProgressing progress, bool wideDisplay) { if (string.IsNullOrWhiteSpace(containerName)) { throw new ArgumentNullException("containerName"); } if (string.IsNullOrWhiteSpace(keyFile)) { throw new ArgumentNullException("keyFile"); } _progress = progress ?? throw new ArgumentNullException("progress"); _containerName = containerName; _wideDisplay = wideDisplay; // Initialize Azure client instances if (!CloudStorageAccount.TryParse(File.ReadAllText(keyFile), out _cloudStorage)) { throw new SmkException("Invalid Azure Access Key"); } _blobClient = _cloudStorage.CreateCloudBlobClient(); _blobContainer = _blobClient.GetContainerReference(_containerName); }
public LocalDirectoryCleaner(string path, ILogging logger, IProgressing progress, bool wideDisplay) { _path = path ?? throw new ArgumentNullException("path"); _logger = logger ?? throw new ArgumentNullException("logger"); _progress = progress ?? throw new ArgumentNullException("progress"); _wideDisplay = wideDisplay; }
/// <summary> /// Constructor /// </summary> public LocalDirectorySource(string basePath, IProgressing progress, bool wideDisplay, CheckLevel checkLevel, bool ignoreCleaning) { _path = basePath ?? throw new ArgumentNullException("basePath"); _pathNoTail = _path.RemoveTail(); _progress = progress ?? throw new ArgumentNullException("progress"); _wideDisplay = wideDisplay; _checkLevel = checkLevel; _ignoreCleaning = ignoreCleaning; }
/// <summary> /// Constructor /// </summary> public GcsBucketSource(string bucketName, string keyFile, IProgressing progress, bool wideDisplay) { if (string.IsNullOrWhiteSpace(bucketName)) { throw new ArgumentNullException("bucketName"); } if (string.IsNullOrWhiteSpace(keyFile)) { throw new ArgumentNullException("keyFile"); } _progress = progress ?? throw new ArgumentNullException("progress"); _bucketName = bucketName; _wideDisplay = wideDisplay; _client = StorageClient.Create(GoogleCredential.FromFile(keyFile)); }
/// <summary> /// Constructor /// </summary> public S3BucketSource(string bucketName, string keyFile, IProgressing progress, bool wideDisplay) { if (string.IsNullOrWhiteSpace(bucketName)) { throw new ArgumentNullException("bucketName"); } if (string.IsNullOrWhiteSpace(keyFile)) { throw new ArgumentNullException("keyFile"); } _progress = progress ?? throw new ArgumentNullException("progress"); _bucketName = bucketName; _wideDisplay = wideDisplay; S3Credentials credentials = S3Credentials.LoadKey(keyFile); _client = new AmazonS3Client(credentials.AccessKeyId, credentials.SecretAccessKey, credentials.AwsRegion); }
public RepositorySourceFactory(ILogging logger, IProgressing progress) { _logger = logger ?? throw new ArgumentNullException("logger"); _progress = progress ?? throw new ArgumentNullException("progress"); }