Repository: incubator-atlas Updated Branches: refs/heads/master c9a912649 -> b1fd69954
ATLAS-1727: Mask userdetails in quick Start utility Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/81d3184d Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/81d3184d Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/81d3184d Branch: refs/heads/master Commit: 81d3184dbceb1e10042e2bbf3cd2130282508b36 Parents: c9a9126 Author: nixonrodrigues <[email protected]> Authored: Tue Apr 11 16:17:54 2017 +0530 Committer: nixonrodrigues <[email protected]> Committed: Wed Apr 12 16:31:12 2017 +0530 ---------------------------------------------------------------------- .../java/org/apache/atlas/utils/AuthenticationUtil.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/81d3184d/common/src/main/java/org/apache/atlas/utils/AuthenticationUtil.java ---------------------------------------------------------------------- diff --git a/common/src/main/java/org/apache/atlas/utils/AuthenticationUtil.java b/common/src/main/java/org/apache/atlas/utils/AuthenticationUtil.java index 6430fb1..b5b0026 100644 --- a/common/src/main/java/org/apache/atlas/utils/AuthenticationUtil.java +++ b/common/src/main/java/org/apache/atlas/utils/AuthenticationUtil.java @@ -22,9 +22,7 @@ import org.apache.atlas.AtlasException; import org.apache.commons.configuration.Configuration; import org.slf4j.Logger; import org.slf4j.LoggerFactory; - -import java.io.BufferedReader; -import java.io.InputStreamReader; +import java.io.Console; /** * Util class for Authentication. @@ -54,11 +52,9 @@ public final class AuthenticationUtil { String password = null; try { - BufferedReader bufferRead = new BufferedReader(new InputStreamReader(System.in)); - System.out.println("Enter username for atlas :-"); - username = bufferRead.readLine(); - System.out.println("Enter password for atlas :-"); - password = bufferRead.readLine(); + Console console = System.console(); + username = console.readLine("Enter username for atlas :- "); + password = new String(console.readPassword("Enter password for atlas :- ")); } catch (Exception e) { System.out.print("Error while reading "); System.exit(1);
