code: private File findFile(File base, Vector pathElements, boolean cs) {
          if (pathElements.size() == 0) {
              return base;
          }
          String current = (String) pathElements.remove(0);
          if (base == null) {
              return findFile(new File(current), pathElements, cs);
          }
          if (!base.isDirectory()) {
              return null;
          }
          String[] files = list(base);
          if (files == null) {
              throw new RuntimeException("IO error scanning directory "
                                       + base.getAbsolutePath());
          }
          boolean[] matchCase = cs ? CS_SCAN_ONLY : CS_THEN_NON_CS;
          for (int i = 0; i < matchCase.length; i++) {
              for (int j = 0; j < files.length; j++) {
                  if (matchCase[i] ? files[j].equals(current)
                                   : files[j].equalsIgnoreCase(current)) {
                      return findFile(new File(base, files[j]), pathElements, cs);
                  }
              }
          }
          return null;
      }
docs: From <code>base</code> traverse the filesystem in order to find
  a file that matches the given stack of names.
  
  @param base base File (dir).
  @param pathElements Vector of path elements (dirs...file).
  @param cs whether to scan case-sensitively.
  @return File object that points to the file in question or null.
  
  @since Ant 1.6.3