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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringaskField(String name, BufferedReader reader, boolean allowEmpty) Ask for a field.protected StringaskField(String name, BufferedReader reader, int length, boolean allowEmpty) Ask for a field.protected LicensedApplicationGet application.final LicensedApplicationGet a licensed application instance.final SecureApplicationGet a secure application instance.
-
Constructor Details
-
AbstractConsoleTool
protected AbstractConsoleTool()Default constructor.
-
-
Method Details
-
getLicensedApplication
Get a licensed application instance.- Returns:
- licensed application
-
getSecureApplication
Get a secure application instance.- Returns:
- secure application
-
getApplication
Get application. It is always a licensed application, even it is not really licensed, and therefore has no registration version.- Returns:
- 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
-