code: boolean processDirectory(String dirname, Collection<String> classNames) throws IOException {
          if (!Files.isDirectory(Paths.get(dirname))) {
              err.printf("%s: not a directory%n", dirname);
              return false;
          }
  
          classPath.add(0, new File(dirname));
  
          if (classNames.isEmpty()) {
              Path base = Paths.get(dirname);
              int baseCount = base.getNameCount();
              try (Stream<Path> paths = Files.walk(base)) {
                  Stream<String> files =
                      paths.filter(p -> p.getNameCount() > baseCount)
                           .map(p -> p.subpath(baseCount, p.getNameCount()))
                           .map(Path::toString);
                  return doFileNames(files);
              }
          } else {
              return doClassNames(classNames);
          }
      }
docs: Processes named class files in the given directory. The directory
  should be the root of a package hierarchy. If classNames is
  empty, walks the directory hierarchy to find all classes.
  
  @param dirname the name of the directory to process
  @param classNames the names of classes to process
  @return true for success, false for failure
  @throws IOException if an I/O error occurs