Package uk.ac.starlink.util
Class LineReader
java.lang.Object
uk.ac.starlink.util.LineReader
Class containing methods for reading strings from the user (standard input).
Both normal and 'masked' reads are provided - the latter is useful
for reading passwords in such a way that they don't appear on the screen.
- Since:
- 27 Nov 2006
- Author:
- Mark Taylor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
readMaskedString
(String prompt, PrintStream outStrm) Reads a line of text from the user without it being visible to onlookers.static String
readString
(String prompt, PrintStream outStrm) Reads a line of text from the user.
-
Constructor Details
-
LineReader
public LineReader()
-
-
Method Details
-
readString
Reads a line of text from the user.- Parameters:
prompt
- short line of text to act as a promptoutStrm
- print stream to use for prompt output - typically System.err- Throws:
IOException
-
readMaskedString
Reads a line of text from the user without it being visible to onlookers. Suitable utility method for soliciting passwords.- Parameters:
prompt
- short line of text to act as a promptoutStrm
- print stream to use for output - typically System.err- Returns:
- string entered by user
- Throws:
IOException
-