Examples of generatePresignedUrl()


Examples of com.amazonaws.services.s3.AmazonS3.generatePresignedUrl()

        GeneratePresignedUrlRequest generatePresignedUrlRequest =
                      new GeneratePresignedUrlRequest(bucket, key);
        generatePresignedUrlRequest.setMethod(HttpMethod.GET); // Default.
        generatePresignedUrlRequest.setExpiration(expiration);

        URL s = s3Client.generatePresignedUrl(generatePresignedUrlRequest);

        JsonObject response = new JsonObject();
        response.addProperty("thumbnailUrl", s.toString());

        resp.getWriter().write(response.toString());
View Full Code Here

Examples of com.amazonaws.services.s3.AmazonS3.generatePresignedUrl()

        // use this method without accessing the internet
        // should throw
        //     IllegalArgumentException: Access key cannot be null.
        // in BasicAWSCredentials
        s3Client.generatePresignedUrl("bucket", "key", new Date());
    }

    @Test
    public void testWithCredentials() throws Exception {
        AmazonS3 s3Client = s3ClientHelper.client(new URI("s3://user:password@host/path"));
View Full Code Here

Examples of com.amazonaws.services.s3.AmazonS3.generatePresignedUrl()

    }

    @Test
    public void testWithCredentials() throws Exception {
        AmazonS3 s3Client = s3ClientHelper.client(new URI("s3://user:password@host/path"));
        URL url = s3Client.generatePresignedUrl("bucket", "key", new Date(0L));
        assertThat(url.toString(), is("http://bucket.s3.amazonaws.com/key?AWSAccessKeyId=user&Expires=0&Signature=o5V2voSQbVEErsUXId6SssCq9OY%3D"));
    }


}
View Full Code Here

Examples of com.amazonaws.services.s3.AmazonS3Client.generatePresignedUrl()

        GeneratePresignedUrlRequest generatePresignedUrlRequest =
                      new GeneratePresignedUrlRequest(bucket, key);
        generatePresignedUrlRequest.setMethod(HttpMethod.GET); // Default.
        generatePresignedUrlRequest.setExpiration(expiration);

        URL s = s3Client.generatePresignedUrl(generatePresignedUrlRequest);

        JsonObject response = new JsonObject();
        response.addProperty("thumbnailUrl", s.toString());

        resp.getWriter().write(response.toString());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.