> + Location location =
> getOnlyElement(blobStore.get().listAssignableLocations());
> + blobStore.get().createContainerInLocation(location,
> container.get());
> +
> + System.out.println("Created container " + container.get() +
> + " for thread " + Thread.currentThread() +
> + " in " + location.toString());
> + }
> +
> + // The md5 as returned by the service, and as calculated locally.
> + String md5Local, md5Remote;
> + Blob blob = null;
> + FileInputStream fis = null;
> + try {
> + fis = new FileInputStream(file);
> + md5Local = DigestUtils.md5Hex(fis);
> + fis.close();
This is actually not exception-safe, you need to call `close` in finally. But
instead of doing this yourself, you can use Guava `Hashing.md5` and
`BaseEncoding.base16`.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/69/files#r22695223