@Override
  public CommandResult execute(CommandInvocation commandInvocation)
      throws IOException, InterruptedException {

    if (help) {
      commandInvocation.getShell().out().println(commandInvocation.getHelpInfo("find"));
      return CommandResult.SUCCESS;
    }

    Searcher entity = new Searcher();
    entity.setFileName(fileName);
    entity.setFolderPath(folderPath);

    searcher.setEntity(entity);

    searcher.execute();

    return CommandResult.SUCCESS;
  }
Ejemplo n.º 2
0
  @Override
  public CommandResult execute(CommandInvocation commandInvocation) throws IOException {
    if (help) {
      commandInvocation.getShell().out().print(commandInvocation.getHelpInfo("cd"));
      return CommandResult.SUCCESS;
    }

    if (arguments == null) {
      updatePrompt(
          commandInvocation,
          commandInvocation
              .getAeshContext()
              .getCurrentWorkingDirectory()
              .newInstance(Config.getHomeDir()));
    } else {
      List<Resource> files =
          arguments.get(0).resolve(commandInvocation.getAeshContext().getCurrentWorkingDirectory());

      if (files.get(0).isDirectory()) updatePrompt(commandInvocation, files.get(0));
    }
    return CommandResult.SUCCESS;
  }