コード例 #1
0
  /** List all files from the AJO */
  public File[] getFiles() {

    // Combine the collections in the Map into one

    Set all = new HashSet();

    Iterator i = ids_to_files.values().iterator();
    while (i.hasNext()) {
      all.addAll((Collection) i.next());
    }

    // Convert to an array
    return (File[]) all.toArray(new File[1]);
  }
コード例 #2
0
  /**
   * 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()]);
  }