@Override
  public Set<File> generateFilePaths(SequencerPoolPartition partition) throws SubmissionException {
    Set<File> filePaths = new HashSet<File>();
    if ((partition.getSequencerPartitionContainer().getRun().getFilePath()) == null) {
      throw new SubmissionException("No valid run filepath!");
    }

    Pool<? extends Poolable> pool = partition.getPool();
    if (pool == null) {
      throw new SubmissionException("partition.getPool=null!");
    } else {
      Collection<Experiment> experiments = pool.getExperiments();
      if (experiments.isEmpty()) {
        throw new SubmissionException("Collection or experiments is empty");
      } else {
        Collection<? extends Dilution> libraryDilutions = pool.getDilutions();
        if (libraryDilutions.isEmpty()) {
          throw new SubmissionException("Collection of libraryDilutions is empty");
        } else {
          for (Dilution l : libraryDilutions) {
            Set<File> files = generateFilePath(partition, l);
            filePaths.addAll(files);
          }
        }
      }
    }
    return filePaths;
  }
  @Override
  public Set<File> generateFilePaths(SequencerPoolPartition partition) throws SubmissionException {
    log.debug("Generating filepaths for partition " + partition.getId());
    Set<File> filePaths = new HashSet<File>();

    Pool pool = partition.getPool();
    if (pool == null) {
      throw new SubmissionException("partition.getPool=null!");
    } else {
      Collection<Experiment> experiments = pool.getExperiments();
      if (experiments.isEmpty()) {
        throw new SubmissionException("Collection or experiments is empty");
      } else {
        Collection<LibraryDilution> libraryDilutions = pool.getDilutions();
        if (libraryDilutions.isEmpty()) {
          throw new SubmissionException("Collection or libraryDilutions is empty");
        } else {
          for (Experiment e : experiments) {
            StringBuilder filePath = new StringBuilder();

            filePath.append(partition.getSequencerPartitionContainer().getRun().getFilePath());
            filePath.append("/Data/Intensities/BaseCalls/PAP/Project_");
            filePath.append(e.getStudy().getProject().getAlias());
            filePath.append("/Sample_");

            for (LibraryDilution l : libraryDilutions) {
              // filePath.append(l.getLibrary().getName()+"/");
              /*
                      +l.getLibrary().getName()+"_"+l.getLibrary().getTagBarcode().getSequence());
              filePath.append("L00"+lane.getPartitionNumber())
              */
              String folder = filePath.toString() + l.getLibrary().getName() + "/*.fastq.gz";
              // System.out.println(folder);
              File file = new File(folder);
              filePaths.add(file);
            }
          }
        }
      }
    }
    return (filePaths);
  }