private String name = getClass().getSimpleName();
private String containerName = getClass().getSimpleName() + "Container";
public void signForPublicAccess() throws Exception {
for (String regionId : api.configuredRegions()) {
SwiftObject object = api.objectApiInRegionForContainer(regionId, containerName).head(name);
long expires = System.currentTimeMillis() / 1000 + 5;
String signature = TemporaryUrlSigner.checkApiEvery(api.accountApiInRegion(regionId), 5) //
.sign("GET", object.uri().getPath(), expires);
URI signed = URI.create(format("%s?temp_url_sig=%s&temp_url_expires=%s", object.uri(), signature, expires));
InputStream publicStream = signed.toURL().openStream();
assertEquals(Strings2.toStringAndClose(publicStream), "swifty");
// let it expire