public class DeviceConsoleProvider extends Object
System.console()
device.
This is preferred over the StreamConsoleProvider
when System.console()
provides a non-null
value, because it can suppress the display of passwords.ConsoleProvider.Factory
Constructor and Description |
---|
DeviceConsoleProvider(Console console) |
Modifier and Type | Method and Description |
---|---|
protected IOException |
closed() |
void |
flush() |
void |
print(String text) |
void |
printErrorMessage(String errorMessage) |
void |
printErrorMessage(Throwable ex) |
void |
println() |
void |
println(String text) |
char |
readFirstChar(String prompt) |
String |
readLine() |
String |
readLine(String prompt) |
String |
readPassword(String prompt) |
boolean |
readYesNo(String prompt,
boolean defaultValue) |
protected void |
showPrompt(String prompt) |
public DeviceConsoleProvider(Console console)
public String readLine(String prompt) throws IOException
IOException
public String readPassword(String prompt) throws IOException
IOException
public void println()
public void print(String text)
public void println(String text)
public void printErrorMessage(String errorMessage)
printErrorMessage
in interface ConsoleProvider
public void printErrorMessage(Throwable ex)
printErrorMessage
in interface ConsoleProvider
public void flush()
protected IOException closed()
protected void showPrompt(String prompt)
public String readLine() throws IOException
readLine
in interface ConsoleProvider
IOException
public char readFirstChar(String prompt) throws IOException
readFirstChar
in interface ConsoleProvider
IOException
public boolean readYesNo(String prompt, boolean defaultValue) throws IOException
readYesNo
in interface ConsoleProvider
IOException
Copyright © 2002-2022 Atlassian. All Rights Reserved.