コード例 #1
0
 private boolean isInternalPageThatDoesntExist(String linkPath) {
   String expandedPath = WikiWordReference.expandPrefix(page, linkPath);
   WikiPagePath path = PathParser.parse(expandedPath);
   if (path == null) {
     return true;
   }
   WikiPage start = path.isRelativePath() ? page.getParent() : page; // TODO -AcD- a better way?
   return !start.getPageCrawler().pageExists(path);
 }
コード例 #2
0
  private String makePathForSymbolicLink(String linkPath) {
    WikiPagePath wikiPagePath = PathParser.parse(linkPath);

    if (wikiPagePath != null) {
      WikiPage parent = wikiPagePath.isRelativePath() ? page.getParent() : page;
      PageCrawler crawler = parent.getPageCrawler();
      WikiPage target = crawler.getPage(wikiPagePath);
      WikiPagePath fullPath;
      if (target != null) {
        fullPath = target.getPageCrawler().getFullPath();
        fullPath.makeAbsolute();
      } else fullPath = new WikiPagePath();
      return fullPath.toString();
    }
    return null;
  }