Beispiel #1
0
 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);
   }
 }
Beispiel #2
0
 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;
   }
 }
Beispiel #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));
    // }
  }