Before getting started Skill Level: Beginner Assumptions: You already gone through Parts 1-5 of Managing Amazon AWS with C#. Additional information: I sometimes cover small sub-topics in a post. Along with AWS, you will also be exposed to: Rhyous.SimpleArgs Step 1 – Add a DeleteBucketDirectory method to BucketManager.cs Edit file called BucketManager.cs. Enter this new method: public static async Task DeleteBucketDirectory(AmazonS3Client client, string bucketName, string directory) { var dirRequest = new DeleteObjectRequest { BucketName = bucketName, Key = directory + "/" }; await client.DeleteObjectAsync(dirRequest); Console.WriteLine($"Created S3 bucket folder: {bucketName}/{directory}/"); } Note: Amazon S3 uses objects with a key ending in a / as a directory, so we have to call DeleteObjectAsync. Step 2 – Update the Action Argument We now need to make this method a valid action for the Action Argument. Edit the ArgsHandler.cs file to define an Action argument. ... AllowedValues = new ObservableCollection<string> { "CreateBucket", "DeleteBucket", "ListFiles", "UploadFile", "CreateBucketDirectory", "DeleteBucketDirectory" }, .
I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too.
Stay tuned to my blog, twitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.
Stay tuned to my blog, twitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.
This article is related to
AWS,csharp,aws,c#,S3
AWS,csharp,aws,c#,S3
No comments:
Post a Comment