code: static PathFileObject createDirectoryPathFileObject(JavacPathFileManager fileManager,
              final Path path, final Path dir) {
          return new PathFileObject(fileManager, path) {
              @Override
              String inferBinaryName(Iterable<? extends Path> paths) {
                  return toBinaryName(dir.relativize(path));
              }
          };
      }
docs: Create a PathFileObject within a directory, such that the binary name
  can be inferred from the relationship to the parent directory.