code: private Page getTargetPage(String targetPath, InternalLinkResolverOptions options) {
  
      if (StringUtils.isEmpty(targetPath)) {
        return null;
      }
  
      // Rewrite target to current site context
      String rewrittenPath;
      if (options.isRewritePathToContext() && !useTargetContext(options)) {
        rewrittenPath = urlHandler.rewritePathToContext(SyntheticNavigatableResource.get(targetPath, resourceResolver));
      }
      else {
        rewrittenPath = targetPath;
      }
      if (StringUtils.isEmpty(rewrittenPath)) {
        return null;
      }
  
      // Get target page referenced by target path and check for acceptance
      Page targetPage = pageManager.getPage(rewrittenPath);
      if (acceptPage(targetPage, options)) {
        return targetPage;
      }
      else {
        return null;
      }
    }
docs: Returns the target page for the given internal content link reference.
  Checks validity of page.
  @param targetPath Repository path
  @return Target page or null if target reference is invalid.