code: public static String buildCannedPolicy(String resourceUrlOrPath,
              Date dateLessThan) {
          return "{\"Statement\":[{\"Resource\":\""
                  + resourceUrlOrPath
                  + "\",\"Condition\":{\"DateLessThan\":{\"AWS:EpochTime\":"
                  + MILLISECONDS.toSeconds(dateLessThan.getTime())
                  + "}}}]}";
      }
docs: Returns a "canned" policy for the given parameters.
  For more information, see <a href=
  "http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-signed-urls-overview.html"
  >Overview of Signed URLs</a>.