MCPcopy Create free account
hub / github.com/MariaDB/server / getLine

Method getLine

storage/connect/Client2.java:102–128  ·  view source on GitHub ↗
(String p, boolean b)

Source from the content-addressed store, hash-verified

100
101 // ==================================================================
102 private static String getLine(String p, boolean b) {
103 String response;
104
105 if (c != null) {
106 // Standard console mode
107 if (b) {
108 response = new String(c.readPassword(p));
109 } else
110 response = c.readLine(p);
111
112 } else {
113 // For instance when testing from Eclipse
114 BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
115
116 System.out.print(p);
117
118 try {
119 // Cannot suppress echo for password entry
120 response = in.readLine();
121 } catch (IOException e) {
122 response = "";
123 } // end of try/catch
124
125 } // endif c
126
127 return (response.isEmpty()) ? null : response;
128 } // end of getLine
129
130} // end of class Client

Callers 1

mainMethod · 0.95

Calls 1

printMethod · 0.45

Tested by

no test coverage detected