示例#1
0
文件: Main.java 项目: casegenie/Genie
 public static void initUI(Subsystem core) {
   try {
     System.out.println("starting ui");
     SimpleTimer s = new SimpleTimer();
     Subsystem ui = (Subsystem) Class.forName("org.alliance.ui.UISubsystem").newInstance();
     ui.init(ResourceSingelton.getRl(), core);
     if (T.t) {
       T.trace("Subsystem UI started in " + s.getTime());
     }
   } catch (Exception t) {
     reportError(t);
   }
 }
示例#2
0
文件: Main.java 项目: casegenie/Genie
 private static Subsystem initCore(String settings, StartupProgressListener l) {
   try {
     SimpleTimer s = new SimpleTimer();
     Subsystem core = (Subsystem) Class.forName("org.alliance.core.CoreSubsystem").newInstance();
     core.init(ResourceSingelton.getRl(), settings, l);
     if (T.t) {
       T.info("" + "Subsystem CORE started in " + s.getTime());
     }
     return core;
   } catch (Throwable t) {
     reportError(t);
     System.err.println(t);
     return null;
   }
 }
示例#3
0
  private void searchLocal(ArrayList<String> params) throws IOException {
    FileType ft = FileType.EVERYTHING;
    if (Character.isDigit(params.get(0).charAt(0)) && params.get(0).length() == 1) {
      ft = FileType.getFileTypeById(Integer.parseInt(params.get(0)));
      params.remove(0);
    }

    String query = "";
    for (String s : params) {
      query += s + " ";
    }

    printer.println("Searching in " + ft.description() + "...");
    SimpleTimer st = new SimpleTimer();
    // int indices[] = core.getShareManager().getFileDatabase().getKeywordIndex().search(query, 100,
    // ft);
    printer.println("...completed in " + st.getTime() + ".");
    // for (int i : indices) {
    // TODO
    // printer.println("  " + core.getShareManager().getFileDatabase().getFd(i));
    // }
  }