Amazon S3 Folders

By July 18, 2011No Comments

When given the task of uploading a couple files to Amazon S3 using Java, it seemed pretty straightforward after breifly looking at the AWS SDK for Java. I have to admit that my knowledge in the area was next to nothing, but none the less I jumped in and started coding, glossing over the details. Well, lets just say there was a little too much glossin’ going on.

I initially started looking at the already present structure using Firefox’s “Amazon S3 Organizer (S3Fox)” which appeared as though it was a simple directory structure. I then assumed that a Bucket was just a fancy name for a folder and that there were a series of nested Buckets. Not being very familiar with the terminology, and in too much of a rush to actually read, I banged my head against the wall using various syntax. At some point I came across some information stating that Buckets cannot be created within other Buckets. Ok, so I guess the root level ones are buckets and the nested ones are folders. So I’m thinking hmmm, these parameters in the function call just aren’t providing input for this extra folder information, given that I’ve tried tacking it onto the Bucket parameter in various different ways.

Well, after my shotgun was out of shells, I decided to actually do some reading to try to find out how to access folders in S3. Doh! Well, as it turns out, S3 doesn’t actually have the concept of folders, and what I was seeing was the plugin’s representation of a folder structure which in reality was a “Key” defined as “myfolder/newfile.txt”.

Ignorance can be bliss, but not this time…sigh…