title: How to set Amazon S3 bucket presigned URL expiration time in 1 year from current date
body: <p>Images are uploaded to an Amazon S3 bucket. I need to get a <strong>presigned URL</strong> from Amazon server. Also I want to set the expiry time of that URL. That can take only maximum of 17 days. But I can't set maximum of 1 year expiration time.</p>
  
  <pre><code>      Calendar cal = Calendar.getInstance();
          cal.add(Calendar.YEAR, 1);
          Date nextYear = cal.getTime();
  
      GeneratePresignedUrlRequest generatePresignedUrlRequest = new GeneratePresignedUrlRequest(
                  "bucketName", "accessname");
          generatePresignedUrlRequest.setMethod(HttpMethod.GET);
          generatePresignedUrlRequest
                  .setExpiration(nextYear);
          URL url = s3client
                  .generatePresignedUrl(generatePresignedUrlRequest);
          bucketURL = url.toString();
  </code></pre>