public class FileCommandInput extends CommandInput
| Constructor and Description |
|---|
FileCommandInput(File inputFile)
Read input from a given file
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
String |
readLine()
Reads a single line from input.
|
String |
readMaskedString(String prompt)
Reads input without echoing back keyboard input.
|
public FileCommandInput(File inputFile) throws FileNotFoundException
inputFile - Given input fileFileNotFoundException - Thrown when file doesn't existpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class CommandInputIOExceptionpublic String readLine() throws IOException
CommandInputreadLine in class CommandInputIOException - allows any communication error.public String readMaskedString(String prompt) throws IOException
CommandInputreadMaskedString in class CommandInputprompt - The full or partial input that user types.IOException - allows any communication error.Copyright © 2008–2022. All rights reserved.