Example usage for com.amazonaws.services.cloudfront CloudFrontUrlSigner getSignedURLWithCannedPolicy

List of usage examples for com.amazonaws.services.cloudfront CloudFrontUrlSigner getSignedURLWithCannedPolicy

Introduction

In this page you can find the example usage for com.amazonaws.services.cloudfront CloudFrontUrlSigner getSignedURLWithCannedPolicy.

Prototype

public static String getSignedURLWithCannedPolicy(final Protocol protocol, final String distributionDomain,
        final File privateKeyFile, final String s3ObjectKey, final String keyPairId, final Date dateLessThan)
        throws InvalidKeySpecException, IOException 

Source Link

Document

Returns a signed URL with a canned policy that grants universal access to private content until a given date.

Usage

From source file:ug.monografico32.model.aws.URLSignerWrapper.java

public String getURLFor(String objectKey) throws InvalidKeySpecException, IOException {

    return CloudFrontUrlSigner.getSignedURLWithCannedPolicy(SignerUtils.Protocol.https, this.distributionDomain,
            this.privateKeyFile, objectKey, this.keyPairID, new Date(System.currentTimeMillis() + 60 * 1000));
}