> +
> + String dateString = Iterables.getFirst(blob.getAllHeaders().get(
> + HttpHeaders.DATE), /*defaultValue=*/ null);
> + if (dateString == null) {
> + throw new Exception("Request does not have date header");
> + }
> +
> + Date blobStoreTime = blobStore.getContext().utils().date()
> + .rfc822DateParse(dateString);
> + System.out.println(blobStoreTime);
> +
> + if (maxSkew != 0) {
> + Date localTime = new Date(System.currentTimeMillis());
> + if (Math.abs(blobStoreTime.getTime() - localTime.getTime()) >
> + 1000 * maxSkew) {
> + throw new Exception("Maximum clock skew exceeded" +
Why throw an exception rather than simply print the skew here? Is the idea that
you would run this command at the beginning of a sequence of commands, ensuring
the sequence fails early if the maximum permissible skew is exceeded?
Also, how about _always_ printing the skew, irrespective of whether or not we
then want to fail the command?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-karaf/pull/37/files#r10064100