コード例 #1
0
        public void mgetl(string bucket, string inputfile, string outputdir)
        {
            try
            {
                // open input file
                StreamReader files = new StreamReader(inputfile);

                // for threading library
                ThreadPool.SetMaxThreads(maxThreads, maxThreads);
                ThreadPoolWait threads = new ThreadPoolWait();

                // loop over and add to S3
                string file;
                while ((file = files.ReadLine()) != null)
                {
                    if (file.Trim() != "")
                    {
                        string key = file.Substring(file.LastIndexOf('\\') + 1);
                        s3Get  get = new s3Get(awsKey, awsSecret, region, bucket, outputdir, key, maxRetry);
                        threads.QueueUserWorkItem(new WaitCallback(get.Run));
                    }
                }

                // wait for all threads to complete
                threads.WaitOne();
            }
            catch (Exception e)
            {
                Console.WriteLine("Error in: '" + inputfile + "': " + e.Message);
            }
        }
コード例 #2
0
ファイル: s3cmd.cs プロジェクト: mmcquillan/s3
        public void mgetl(string bucket, string inputfile, string outputdir)
        {
            try
            {

                // open input file
                StreamReader files = new StreamReader(inputfile);

                // for threading library
                ThreadPool.SetMaxThreads(maxThreads, maxThreads);
                ThreadPoolWait threads = new ThreadPoolWait();

                // loop over and add to S3
                string file;
                while ((file = files.ReadLine()) != null)
                {
                    if (file.Trim() != "")
                    {
                        string key = file.Substring(file.LastIndexOf('\\') + 1);
                        s3Get get = new s3Get(awsKey, awsSecret, region, bucket, outputdir, key, maxRetry);
                        threads.QueueUserWorkItem(new WaitCallback(get.Run));
                    }
                }

                // wait for all threads to complete
                threads.WaitOne();
            }
            catch (Exception e)
            {
                Console.WriteLine("Error in: '" + inputfile + "': " + e.Message);
            }
        }
コード例 #3
0
        public void get(string bucket, string key, string dir)
        {
            s3Get get = new s3Get(awsKey, awsSecret, region, bucket, dir, key, maxRetry);

            get.Run(null);
        }
コード例 #4
0
ファイル: s3cmd.cs プロジェクト: mmcquillan/s3
 public void get(string bucket, string key, string dir)
 {
     s3Get get = new s3Get(awsKey, awsSecret, region, bucket, dir, key, maxRetry);
     get.Run(null);
 }