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