List of usage examples for com.amazonaws.services.s3.model GeneratePresignedUrlRequest GeneratePresignedUrlRequest
public GeneratePresignedUrlRequest(String bucketName, String key, HttpMethod method)
From source file:org.whispersystems.textsecuregcm.s3.UrlSigner.java
License:Open Source License
public URL getPreSignedUrl(long attachmentId, HttpMethod method) { AmazonS3 client = new AmazonS3Client(credentials); GeneratePresignedUrlRequest request = new GeneratePresignedUrlRequest(bucket, String.valueOf(attachmentId), method);/*from ww w.j a va 2 s. c om*/ request.setExpiration(new Date(System.currentTimeMillis() + DURATION)); request.setContentType("application/octet-stream"); client.setS3ClientOptions(S3ClientOptions.builder().setAccelerateModeEnabled(true).build()); return client.generatePresignedUrl(request); }
From source file:org.whispersystems.textsecuregcm.util.UrlSigner.java
License:Open Source License
public URL getPreSignedUrl(long attachmentId, HttpMethod method) { AmazonS3 client = new AmazonS3Client(credentials); GeneratePresignedUrlRequest request = new GeneratePresignedUrlRequest(bucket, String.valueOf(attachmentId), method);/*from w w w . j ava2 s .co m*/ request.setExpiration(new Date(System.currentTimeMillis() + DURATION)); request.setContentType("application/octet-stream"); return client.generatePresignedUrl(request); }