Code example for Console

Methods: readLine

0
      final String prompt = String.format(fmt, args);
      String r;
      if (def != null) {
        r = console.readLine("%-30s [%s]: ", prompt, def);
      } else { 
        r = console.readLine("%-30s : ", prompt);
      } 
      if (r == null) {
        throw abort(); 
      } 
      r = r.trim();
      if (r.isEmpty()) {
        return def;
      } 
      return r;
    } 
 
    @Override 
    public String readString(String def, Set<String> allowedValues, String fmt,
        Object... args) {
      for (;;) {