예제 #1
0
  /*................................................................................................*/
  private boolean hireFillers(String directoryPath) {
    String[] files = directory.list();
    String treePath;
    for (int i = 0; i < files.length; i++) {
      if (files[i] != null) {
        String fileLowerCase = files[i].toLowerCase();
        if (fileLowerCase.endsWith(".nex") || fileLowerCase.endsWith(".nexus")) {
          treePath = directoryPath + MesquiteFile.fileSeparator + files[i];
          File treeFile = new File(treePath);
          String treeFileName = treeFile.getName();
          if (StringUtil.blank(treeFileName)) {
            return false;
          }
          TreeBlockFiller newFiller;
          newFiller =
              (TreeBlockFiller)
                  hireNamedEmployee(TreeBlockFiller.class, "#SampleOneTreeFromFile"); // treePath);
          if (newFiller != null) {
            if (((SampleOneTreeFromFile) newFiller).setFilePath(treePath)
                && ((SampleOneTreeFromFile) newFiller).processFile()) {
              fillerTasks.addElement(newFiller);
            } else
              Debugg.println(
                  "Filler "
                      + i
                      + " processFile = "
                      + ((SampleOneTreeFromFile) newFiller).processFile());
          }
        }
      }
    }

    return true;
  }