simple amazon s3 support
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

S3 Simple

This project is a simple java library for connecting to Amazon S3.

It's the s3-shell sample code from Amazon (no longer seems to be available from the AWS Sample code site).

And a Java Base64 class taken from:

For general purpose S3 use, you really should be using Amazon's office AWS Java SDK (github:

BUT, I needed something super simple that would work with the restrictions around google app engine... namely, no threads, no sockets, and... other restrictions...

So, this is the base s3-shell code, with the fix mentioned in the comments, and the Base64 class stolen from another aws example (s3-shell previously used a com.sun class, which you can't do in AE)...

The S3 support is pretty basic...


S3Store s3 = new S3Store("", ACCESS_KEY, SECRET_KEY);

// upload an item as public-read
s3.storeItem("test", new String("hello").getBytes(), "public-read");

// upload a js file, with a cache control-header
final Map<String, List<String>> headers = new HashMap<String, List<String>>();
headers.put("Cache-Control", Collections.singletonList("max-age=300, must-revalidate"));
headers.put("Content-Type", Collections.singletonList("application/x-javascript"));

s3.storeItem("test2.js", new String("document.write('hello');").getBytes(), "public-read", headers);


Licensed under the terms of the Apache Software License v2.0.