Class AbstractConsoleTool

java.lang.Object
ch.autumo.commons.console.AbstractConsoleTool
Direct Known Subclasses:
Encoder, Register

public abstract class AbstractConsoleTool extends Object
Abstract console tool - delivers secure and licensed application.
  • Constructor Details

    • AbstractConsoleTool

      public AbstractConsoleTool()
  • Method Details

    • getLicensedApplication

      public final LicensedApplication getLicensedApplication()
      Get a licensed application instance.
      Returns:
      licensed application
    • getSecureApplication

      public final SecureApplication 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 name
      reader - the sysetm input reader
      allowEmpty - 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 name
      reader - the sysetm input reader
      length - 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 name
      allowEmpty - true, if field can be empty
      Returns:
      requested value
      Throws:
      IOException - when reader fails