Esempio n. 1
0
 public void WriteAllText()
 {
     using (AWS_S3_Client client = new AWS_S3_Client(AmazonS3ServiceURL, AmazonS3AccessKey, AmazonS3SecretKey))
     {
         client.WriteAllText(backet_name + "/writeText.txt", "WriteText");
     }
 }
Esempio n. 2
0
 public void DeleteDirectory2()
 {
     using (AWS_S3_Client client = new AWS_S3_Client(AmazonS3ServiceURL, AmazonS3AccessKey, AmazonS3SecretKey))
     {
         client.DeleteDirectory(backet_name + "/t44/");
     }
 }
Esempio n. 3
0
 public void CreateDirectory()
 {
     using (AWS_S3_Client client = new AWS_S3_Client(AmazonS3ServiceURL, AmazonS3AccessKey, AmazonS3SecretKey))
     {
         client.CreateDirectory(backet_name, "t44");
     }
 }
Esempio n. 4
0
 public void Exists_FALSE2()
 {
     using (AWS_S3_Client client = new AWS_S3_Client(AmazonS3ServiceURL, AmazonS3AccessKey, AmazonS3SecretKey))
     {
         var ok = client.Exists(backet_name + "/t444");
         Assert.False(ok);
     }
 }
Esempio n. 5
0
 public void Exists_OK()
 {
     using (AWS_S3_Client client = new AWS_S3_Client(AmazonS3ServiceURL, AmazonS3AccessKey, AmazonS3SecretKey))
     {
         var ok = client.Exists(backet_name, "t44/");
         Assert.True(ok);
     }
 }
Esempio n. 6
0
 public void ReadAllText()
 {
     using (AWS_S3_Client client = new AWS_S3_Client(AmazonS3ServiceURL, AmazonS3AccessKey, AmazonS3SecretKey))
     {
         String text = client.ReadAllText(backet_name + "/writeText.txt");
         output.WriteLine("Text >" + text);
     }
 }
Esempio n. 7
0
 public void DeleteFiles()
 {
     using (AWS_S3_Client client = new AWS_S3_Client(AmazonS3ServiceURL, AmazonS3AccessKey, AmazonS3SecretKey))
     {
         List <String> list = client.GetFiles(backet_name, "gta");
         client.DeleteFiles(backet_name, list);
     }
 }
Esempio n. 8
0
 public void GetFileListFilter()
 {
     using (AWS_S3_Client client = new AWS_S3_Client(AmazonS3ServiceURL, AmazonS3AccessKey, AmazonS3SecretKey))
     {
         List <String> list = client.GetFiles(backet_name, "ean");
         foreach (var s in list)
         {
             output.WriteLine(s);
         }
     }
 }
Esempio n. 9
0
        public void Copy()
        {
            using (AWS_S3_Client client = new AWS_S3_Client(AmazonS3ServiceURL, AmazonS3AccessKey, AmazonS3SecretKey))
            {
                Boolean ret = client.Copy(@"C:/development/test.txt", backet_name,
                                          "ean/t12");

                Boolean ret2 = client.Copy(@"C:/development/test.txt", backet_name,
                                           "ean/t11");
            }
        }
Esempio n. 10
0
 public void CopyStream()
 {
     using (AWS_S3_Client client = new AWS_S3_Client(AmazonS3ServiceURL, AmazonS3AccessKey, AmazonS3SecretKey))
     {
         String filePath = @"C:\development\NuGet_Library\AWS_S3Writer.1.0.0.nupkg";
         using (var fileToUploadStream =
                    new FileStream(filePath, FileMode.Open, FileAccess.Read))
         {
             client.CopyStream(fileToUploadStream, backet_name, "t44/tt.nupkg");
         }
     }
 }
Esempio n. 11
0
        public void ParrallelUploadFile()
        {
            using (AWS_S3_Client client = new AWS_S3_Client(AmazonS3ServiceURL, AmazonS3AccessKey, AmazonS3SecretKey))
            {
                String[] FileList = { @"C:/development/test.txt", @"C:\development\NuGet_Library\AWS_S3Writer.1.0.0.nupkg" };

                Parallel.ForEach(FileList, new ParallelOptions {
                    MaxDegreeOfParallelism = 8
                }, (st) =>
                {
                    Boolean ret = client.Copy(st, backet_name,
                                              "ean1/t121");
                });
            }
        }
Esempio n. 12
0
        public void CreateClient()
        {
            try
            {
                DateTime start = DateTime.Now;
                output.WriteLine($"Start{start}");

                using (AWS_S3_Client client = new AWS_S3_Client(AmazonS3ServiceURL, AmazonS3AccessKey, AmazonS3SecretKey))
                {
                }

                DateTime end = DateTime.Now;

                output.WriteLine($"End: {end} ");

                output.WriteLine("ok");
            }
            catch (Exception ex)
            {
                output.WriteLine(ex.Message);
            }
        }