Пример #1
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;
  }
  private String makePathForSymbolicLink(String linkPath) throws Exception {
    WikiPagePath wikiPagePath = PathParser.parse(linkPath);

    if (wikiPagePath != null) {
      WikiPage parent = wikiPagePath.isRelativePath() ? page.getParent() : page; // TODO
      // -AcD-
      // a
      // better
      // way?
      PageCrawler crawler = parent.getPageCrawler();
      WikiPage target = crawler.getPage(parent, wikiPagePath);
      WikiPagePath fullPath;
      if (target != null) {
        fullPath = crawler.getFullPath(target);
        fullPath.makeAbsolute();
      } else fullPath = new WikiPagePath();
      return fullPath.toString();
    }
    return null;
  }