public void execute() throws IOException {
    final SubtitleLinkSearchCallback searchListener =
        new SearchListenerImplementation(downloader, cli, output);

    final boolean search = cli.search();
    if (search) {
      final String searchTerm = cli.searchTerm();
      output.outVerbose("Procurando '" + searchTerm + "' ...");
      legendasTv.search(searchTerm, searchListener);
    }

    if (cli.showNewAdditions()) {
      output.outVerbose("Novas legendas:");
      final int newAdditionsPageCountToShow = cli.newAdditionsPageCountToShow();
      legendasTv.getNewer(
          newAdditionsPageCountToShow,
          new NewSubtitleLinkFoundCallback() {

            @Override
            public void processAndReturnIfMatches(SubtitleAndLink nameAndlink) {
              output.out(nameAndlink.name);
            }
          });
    }
    httpclient.close();
  }
 public static void compileApp(Application app, OutputListener listener) {
   if (app.scmUser == null) {
     return;
   }
   File localPath = new File(DeployManager.repoPath, app.id);
   if (!localPath.exists()) {
     logger.info("create local path:{}", localPath.getAbsolutePath());
     localPath.mkdirs();
   }
   WorkingCopy wc =
       new WorkingCopy(app.scmUser, app.scmPassword, app.scmPath, localPath.getAbsolutePath());
   wc.setOutputListener(listener);
   try {
     wc.cleanup();
     wc.checkout();
     wc.update();
   } catch (SVNException e) {
     logger.catching(e);
     listener.onOutput(e.getMessage());
     return;
   }
   //
   if (app.antTarget != null) {
     AntManager antManager = new AntManager(DeployManager.antPath);
     antManager.setOutputListener(listener);
     antManager.setCommonLib(DeployManager.antCommonLibPath);
     File buildFile = new File(localPath, "build.xml");
     try {
       antManager.antCall(app.antTarget, buildFile.getAbsolutePath());
     } catch (Exception e) {
       logger.catching(e);
       listener.onOutput(e.getMessage());
       return;
     }
   }
 }
 public void process(final SubtitlePackageAndLink subAndLink) {
   String name = subAndLink.name;
   outputListener.out(name);
 }