Browse files

add a README section that explains how to retrieve the contents of a …

…bucket
  • Loading branch information...
1 parent 3469440 commit 903c4d2ef5520f37d6342886ab52db7b415ca67d @yob committed Nov 7, 2011
Showing with 23 additions and 1 deletion.
  1. +23 −1 README.md
View
24 README.md
@@ -151,7 +151,29 @@ The response data can also be streamed:
# .. handle the individual chunk
end
end
-
+
+Bucket Listing
+=============
+
+You can retreive a list of the contents of a bucket:
+
+ EM.run do
+ bucket = Happening::S3::Bucket.new( 'bucket', :aws_access_key_id => 'Your-ID', :aws_secret_access_key => 'secret')
+ bucket.get do |response|
+ puts response.response
+ end
+ end
+
+The listing is in XML, you will need to parse it yourself.
+
+To limit the bucket list keys with a certain prefix:
+
+ EM.run do
+ bucket = Happening::S3::Bucket.new( 'bucket', :aws_access_key_id => 'Your-ID', :aws_secret_access_key => 'secret', :prefix => "foo")
+ bucket.get do |response|
+ puts response.response
+ end
+ end
SSL Support
=============

0 comments on commit 903c4d2

Please sign in to comment.