コード例 #1
0
ファイル: CHIA.java プロジェクト: claudiomenghi/CHIA
  public CHIA(Writer out) throws IOException {
    Preconditions.checkNotNull(out);
    this.out = out;

    this.automataConsole = new CHIAAutomataConsole();
    this.console = new ConsoleReader();
    this.console.setExpandEvents(false);

    console.setPrompt("CHIA> ");
    usage();

    if (ClassLoader.getSystemResource("History.txt") != null) {
      console.setHistory(
          new FileHistory(new File(ClassLoader.getSystemResource("History.txt").getPath())));
    } else {
      out.write("The History file cannot be loaded" + "\n");
    }
    out.write("CHIA Started\n");
    out.flush();
    if (ClassLoader.getSystemResource("log4j.properties") != null) {

      PropertyConfigurator.configure(ClassLoader.getSystemResource("log4j.properties"));
    } else {
      out.write("The logging file cannot be loaded" + "\n");
    }
    out.flush();
  }
コード例 #2
0
 private void initAdminShell() throws IOException {
   if (_history != null) {
     _console.setHistory(_history);
   }
   _console.addCompleter(_userAdminShell);
   _console.println(_userAdminShell.getHello());
   _console.flush();
 }