Exemplo n.º 1
0
        public void Test_Syn()
        {
            //Sync Directory
            SyncSettings settings = CakeHelper.CreateEnvironment().CreateSyncSettings();

            settings.BucketName = "cake-aws-s3";
            settings.KeyPrefix  = "s3.tests";

            IS3Manager     manager = CakeHelper.CreateS3Manager();
            IList <string> keys    = manager.SyncUpload(new DirectoryPath("../../"), settings);

            Assert.NotEmpty(keys);
        }
Exemplo n.º 2
0
        public async Task Test_Syn()
        {
            //Sync Directory
            SyncSettings settings = CakeHelper.CreateEnvironment().CreateSyncSettings();

            settings.BucketName = "cake-aws-s3";
            settings.KeyPrefix  = "s3.tests";

            IS3Manager     manager = CakeHelper.CreateS3Manager();
            IList <string> keys    = await manager.SyncUpload(new DirectoryPath("./Files"), settings);

            keys.ShouldBeEmpty();
        }
Exemplo n.º 3
0
        public async Task Test_Upload_ContentLength()
        {
            //Upload
            UploadSettings settings = CakeHelper.CreateEnvironment().CreateUploadSettings();

            settings.BucketName = "cake-aws-s3";

            settings.GenerateContentLength = true;
            settings.CompressContent       = true;
            settings.CannedACL             = Amazon.S3.S3CannedACL.PublicRead;
            settings.CacheControl          = "private, max-age=86400";

            IS3Manager manager = CakeHelper.CreateS3Manager();
            await manager.Upload(new FilePath("./Files/Test.css"), "Tester.css", settings);
        }
Exemplo n.º 4
0
        public async Task Test_Meta()
        {
            //Upload
            UploadSettings settings = CakeHelper.CreateEnvironment().CreateUploadSettings();

            settings.BucketName = "cake-aws-s3";

            IS3Manager manager = CakeHelper.CreateS3Manager();
            await manager.Upload(new FilePath("./Files/Encoding.txt"), "Encodings.txt", settings);



            //Get Meta
            MetadataCollection meta = await manager.GetObjectMetaData("Encodings.txt", "", settings);

            string metaHash = meta["x-amz-meta-hashtag"];
        }
Exemplo n.º 5
0
        public void Test_Meta()
        {
            //Upload
            UploadSettings settings = CakeHelper.CreateEnvironment().CreateUploadSettings();

            settings.BucketName = "cake-aws-s3";

            IS3Manager manager = CakeHelper.CreateS3Manager();

            manager.Upload(new FilePath("../../packages.config"), "packages.config", settings);



            //Get Meta
            MetadataCollection meta = manager.GetObjectMetaData("packages.config", "", settings);

            string metaHash = meta["x-amz-meta-hashtag"];
        }
Exemplo n.º 6
0
        public static IS3Manager CreateS3Manager()
        {
            var environment = CakeHelper.CreateEnvironment();

            return(new S3Manager(new FileSystem(), environment, new DebugLog()));
        }