com.atlassian.jira.configurator.console
Class DeviceConsoleProvider

java.lang.Object
  extended by com.atlassian.jira.configurator.console.DeviceConsoleProvider
All Implemented Interfaces:
ConsoleProvider

public class DeviceConsoleProvider
extends Object

Implements a console as backed by a Java 1.6 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.

Since:
v5.1

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.atlassian.jira.configurator.console.ConsoleProvider
ConsoleProvider.Factory
 
Constructor Summary
DeviceConsoleProvider(Console console)
           
 
Method Summary
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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeviceConsoleProvider

public DeviceConsoleProvider(Console console)
Method Detail

readLine

public String readLine(String prompt)
                throws IOException
Throws:
IOException

readPassword

public String readPassword(String prompt)
                    throws IOException
Throws:
IOException

println

public void println()

print

public void print(String text)

println

public void println(String text)

printErrorMessage

public void printErrorMessage(String errorMessage)
Specified by:
printErrorMessage in interface ConsoleProvider

printErrorMessage

public void printErrorMessage(Throwable ex)
Specified by:
printErrorMessage in interface ConsoleProvider

flush

public void flush()

closed

protected IOException closed()

showPrompt

protected void showPrompt(String prompt)

readLine

public String readLine()
                throws IOException
Specified by:
readLine in interface ConsoleProvider
Throws:
IOException

readFirstChar

public char readFirstChar(String prompt)
                   throws IOException
Specified by:
readFirstChar in interface ConsoleProvider
Throws:
IOException

readYesNo

public boolean readYesNo(String prompt,
                         boolean defaultValue)
                  throws IOException
Specified by:
readYesNo in interface ConsoleProvider
Throws:
IOException


Copyright © 2002-2014 Atlassian. All Rights Reserved.