コード例 #1
0
        /// <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);
        }
コード例 #2
0
 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;
 }
コード例 #3
0
 /// <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;
 }
コード例 #4
0
        /// <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));
        }
コード例 #5
0
        /// <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);
        }
コード例 #6
0
 public RepositorySourceFactory(ILogging logger, IProgressing progress)
 {
     _logger   = logger ?? throw new ArgumentNullException("logger");
     _progress = progress ?? throw new ArgumentNullException("progress");
 }