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
IOExceptionpublic String readPassword(String prompt) throws IOException
IOExceptionpublic void println()
public void print(String text)
public void println(String text)
public void printErrorMessage(String errorMessage)
printErrorMessage in interface ConsoleProviderpublic void printErrorMessage(Throwable ex)
printErrorMessage in interface ConsoleProviderpublic void flush()
protected IOException closed()
protected void showPrompt(String prompt)
public String readLine() throws IOException
readLine in interface ConsoleProviderIOExceptionpublic char readFirstChar(String prompt) throws IOException
readFirstChar in interface ConsoleProviderIOExceptionpublic boolean readYesNo(String prompt, boolean defaultValue) throws IOException
readYesNo in interface ConsoleProviderIOExceptionCopyright © 2002-2017 Atlassian. All Rights Reserved.