code: @Nullable
    private DirectoryEntry followSymbolicLink(File dir, SymbolicLink link, int linkDepth)
        throws IOException {
      if (linkDepth >= MAX_SYMBOLIC_LINK_DEPTH) {
        throw new IOException("too many levels of symbolic links");
      }
  
      return lookUp(dir, link.target(), Options.FOLLOW_LINKS, linkDepth + 1);
    }
docs: Returns the directory entry located by the target path of the given symbolic link, resolved
  relative to the given directory.