Package ch.autumo.commons.console
Class AbstractConsoleTool
java.lang.Object
ch.autumo.commons.console.AbstractConsoleTool
Abstract console tool - delivers secure and licensed application.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
askField
(String name, BufferedReader reader, boolean allowEmpty) Ask for a field.protected String
askField
(String name, BufferedReader reader, int length, boolean allowEmpty) Ask for a field.final LicensedApplication
Get a licensed application instance.final SecureApplication
Get a secure application instance.
-
Constructor Details
-
AbstractConsoleTool
public AbstractConsoleTool()
-
-
Method Details
-
getLicensedApplication
Get a licensed application instance.- Returns:
- licensed application
-
getSecureApplication
Get a secure application instance.- Returns:
- secure application
-
askField
protected String askField(String name, BufferedReader reader, boolean allowEmpty) throws IOException Ask for a field.- Parameters:
name
- field namereader
- the sysetm input readerallowEmpty
- true, if field can be empty- Returns:
- requested value
- Throws:
IOException
- when reader fails
-
askField
protected String askField(String name, BufferedReader reader, int length, boolean allowEmpty) throws IOException Ask for a field.- Parameters:
name
- field namereader
- the sysetm input readerlength
- the overall space used for the field name (spaces filled up to the semicolon) or 0 for no space filling but adding one space after the field nameallowEmpty
- true, if field can be empty- Returns:
- requested value
- Throws:
IOException
- when reader fails
-