private void doExecute() throws Exception {
    File fileName = new File(_options._arguments().get(0));

    if (!fileName.exists()) {
      addError("open", "Unable to find specified file " + fileName.getAbsolutePath());
      return;
    }

    IDEConnector connector = null;

    try {
      connector = new IDEConnector();
    } catch (Exception e) {

      // ignore

    }

    if (connector == null) {
      addError("open", "Unable to connect to Eclipse/Liferay IDE instance.");
      return;
    }

    if (fileName.isDirectory()) {
      Object retval = connector.openDir(fileName);

      if (retval != null) {
        addError("open", retval.toString());
        return;
      }
    }
  }
  public void execute() throws Exception {
    List<String> args = _options._arguments();

    if (args.size() == 0) {

      // Default command

      printHelp();
    } else {
      doExecute();
    }
  }
 private void printHelp() throws Exception {
   Formatter f = new Formatter();
   _options._command().help(f, this);
   _blade.out().println(f);
   f.close();
 }