/**
   * List all the files in the portfolio that were created as a result of executing this task (and
   * streamed back)
   */
  public File[] getFiles(AbstractAction task, Portfolio portfolio) {

    Integer task_id = new Integer(task.getId().getValue());

    Collection task_files = (Collection) ids_to_files.get(task_id);

    if (task_files == null) {
      return new File[0];
    }

    Set collected = new HashSet();

    // Got some files, look for the ones in the requested Portfolio

    Iterator i = task_files.iterator();
    while (i.hasNext()) {
      File f = (File) i.next();
      if (f.getPath().indexOf(portfolio.getUPLDirectoryName()) > 0) {
        collected.add(f);
      }
    }

    return (File[]) collected.toArray(new File[collected.size()]);
  }