From 8a1dcceccea5cfe9fb0c94daa2517cd64a16b3c0 Mon Sep 17 00:00:00 2001 From: Akira Ajisaka Date: Sat, 11 Jun 2016 03:31:06 +0900 Subject: [PATCH] HADOOP-13213. Small Documentation bug with AuthenticatedURL in hadoop-auth. Contributed by Tom Ellis. This closes #97. --- .../security/authentication/client/AuthenticatedURL.java | 4 ++-- .../hadoop-auth/src/site/markdown/Examples.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/client/AuthenticatedURL.java b/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/client/AuthenticatedURL.java index f87d9d8d5a..6604c3ffc1 100644 --- a/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/client/AuthenticatedURL.java +++ b/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/client/AuthenticatedURL.java @@ -44,14 +44,14 @@ * URL url = new URL("http://foo:8080/bar"); * AuthenticatedURL.Token token = new AuthenticatedURL.Token(); * AuthenticatedURL aUrl = new AuthenticatedURL(); - * HttpURLConnection conn = new AuthenticatedURL(url, token).openConnection(); + * HttpURLConnection conn = new AuthenticatedURL().openConnection(url, token); * .... * // use the 'conn' instance * .... * * // establishing a follow up connection using a token from the previous connection * - * HttpURLConnection conn = new AuthenticatedURL(url, token).openConnection(); + * HttpURLConnection conn = new AuthenticatedURL().openConnection(url, token); * .... * // use the 'conn' instance * .... diff --git a/hadoop-common-project/hadoop-auth/src/site/markdown/Examples.md b/hadoop-common-project/hadoop-auth/src/site/markdown/Examples.md index 7efb642d7d..4dad79dd06 100644 --- a/hadoop-common-project/hadoop-auth/src/site/markdown/Examples.md +++ b/hadoop-common-project/hadoop-auth/src/site/markdown/Examples.md @@ -57,9 +57,9 @@ Use the `AuthenticatedURL` class to obtain an authenticated HTTP connection: URL url = new URL("http://localhost:8080/hadoop-auth/kerberos/who"); AuthenticatedURL.Token token = new AuthenticatedURL.Token(); ... - HttpURLConnection conn = new AuthenticatedURL(url, token).openConnection(); + HttpURLConnection conn = new AuthenticatedURL().openConnection(url, token); ... - conn = new AuthenticatedURL(url, token).openConnection(); + conn = new AuthenticatedURL().openConnection(url, token); ... Building and Running the Examples