Skip to content

Commit

Permalink
fix javadocs / parameter order in CloudFrontCookieSigner
Browse files Browse the repository at this point in the history
  • Loading branch information
EronHennessey committed Oct 14, 2016
1 parent 9639ccc commit 2b28338
Showing 1 changed file with 21 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,12 @@
// https://github.com/aws/aws-sdk-net/blob/master/sdk/src/Services/CloudFront/Custom/_bcl/AmazonCloudFrontCookieSigner.cs

/**
* Utility class for generating pre-signed Set-Cookie headers for serving private CloudFront
* content. All dates must be in UTC. Use {@link Calendar} to set the timezone
* specifically before converting to a {@link Date} object, or else use
* {@link DateUtils} to turn a UTC date String into a Date object.
*
* Utility class for generating pre-signed Set-Cookie headers for serving private CloudFront content.
* <p>
* All dates must be in UTC. You can use {@link Calendar} to set the timezone
* before converting to a {@link Date} object, or use {@link DateUtils} to turn
* a UTC date String into a Date object.
* <p>
* <pre>
* Protocol protocol = Protocol.https;
* String distributionDomain = "d1b2c3a4g5h6.cloudfront.net";
Expand All @@ -64,21 +65,26 @@
* String ipRange = "192.168.0.1/24";
*
* CookiesForCannedPolicy cookies = CloudFrontCookieSigner.getCookiesForCannedPolicy(
* protocol, distributionDomain, privateKeyFile,
* s3ObjectKey, keyPairId, activeFrom);
* protocol, distributionDomain, privateKeyFile, s3ObjectKey,
* keyPairId, expiresOn);
*
* HttpClient client = new DefaultHttpClient();
* HttpGet httpGet = new HttpGet(SignerUtils.generateResourcePath(protocol, distributionDomain, resourcePath));
* HttpGet httpGet = new HttpGet(
* SignerUtils.generateResourcePath(protocol, distributionDomain,
* resourcePath));
*
* httpGet.addHeader("Cookie", cookies.getExpires().getKey() + "=" +
* cookies.getExpires().getValue());
* httpGet.addHeader("Cookie", cookies.getSignature().getKey() + "=" +
* cookies.getSignature().getValue());
* httpGet.addHeader("Cookie", cookies.getKeyPairId().getKey() + "=" +
* cookies.getKeyPairId().getValue());
*
* httpGet.addHeader("Cookie", cookies.getExpires().getKey() + "=" + cookies.getExpires().getValue());
* httpGet.addHeader("Cookie", cookies.getSignature().getKey() + "=" + cookies.getSignature().getValue());
* httpGet.addHeader("Cookie", cookies.getKeyPairId().getKey() + "=" + cookies.getKeyPairId().getValue());
* HttpResponse response = client.execute(httpGet);
*
* CookiesForCustomPolicy cookies2 = CloudFrontCookieSigner.getCookiesForCustomPolicy(
* protocol, distributionDomain, privateKeyFile,
* s3ObjectKey, keyPairId, activeFrom,
* expiresOn, ipRange);
* protocol, distributionDomain, privateKeyFile, s3ObjectKey,
* keyPairId, expiresOn, activeFrom, ipRange);
* </pre>
*
* @see DateUtils
Expand Down Expand Up @@ -396,4 +402,4 @@ public void setPolicy(String policy) {
this.policy = new CookieKeyValuePair(POLICY_KEY, policy);
}
}
}
}

0 comments on commit 2b28338

Please sign in to comment.