Commit 81d3184d by nixonrodrigues

ATLAS-1727: Mask userdetails in quick Start utility

parent c9a91264
...@@ -22,9 +22,7 @@ import org.apache.atlas.AtlasException; ...@@ -22,9 +22,7 @@ import org.apache.atlas.AtlasException;
import org.apache.commons.configuration.Configuration; import org.apache.commons.configuration.Configuration;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import java.io.Console;
import java.io.BufferedReader;
import java.io.InputStreamReader;
/** /**
* Util class for Authentication. * Util class for Authentication.
...@@ -54,11 +52,9 @@ public final class AuthenticationUtil { ...@@ -54,11 +52,9 @@ public final class AuthenticationUtil {
String password = null; String password = null;
try { try {
BufferedReader bufferRead = new BufferedReader(new InputStreamReader(System.in)); Console console = System.console();
System.out.println("Enter username for atlas :-"); username = console.readLine("Enter username for atlas :- ");
username = bufferRead.readLine(); password = new String(console.readPassword("Enter password for atlas :- "));
System.out.println("Enter password for atlas :-");
password = bufferRead.readLine();
} catch (Exception e) { } catch (Exception e) {
System.out.print("Error while reading "); System.out.print("Error while reading ");
System.exit(1); System.exit(1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment