c# - How do I get a bucket by name in the .Net S3 SDK? -


i'm trying find method using amazon s3 sdk .net bucket name. can find listallbuckets(), don't want have try find response.

this worked me:

public static s3bucket gets3bucket(string bucket) {     try     {         amazons3 client = amazon.awsclientfactory.createamazons3client(accesskeyid, secretaccesskeyid);         return client.listbuckets().buckets.where(b => b.bucketname == bucket).single();     }     catch (amazons3exception amazons3exception)     {         throw amazons3exception;     } } 

Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -