code: public String translateLink(String link) {
  
          String translatedLink = null;
          translatedLink = (String)m_fileIndex.get(link.replace('\\', '/'));
  
          if (translatedLink == null) {
              // its an anchor link, so copy use it
              if (link.startsWith("#")) {
                  translatedLink = link;
              }
  
              // relative link to OpenCms root
              else if (link.startsWith("/")) {
  
                  // strip cms context path
                  link = CmsLinkManager.removeOpenCmsContext(link);
  
                  // check if resource exists
                  if ((m_keepBrokenLinks) || (m_cmsObject.existsResource(link))) {
                      translatedLink = link;
                  }
              }
  
              else {
  
                  String fileBase = getBasePath(m_inputDir, link);
                  String cmsBase = (String)m_parents.get(fileBase);
                  if (cmsBase != null) {
                      String outLink = cmsBase + link.substring(fileBase.length()).replace('\\', '/');
                      if ((m_keepBrokenLinks) || (m_cmsObject.existsResource(outLink))) {
                          translatedLink = outLink;
                      }
                  }
              }
          }
  
          // if the link goes to a directory, lets link to the index page within
          if ((translatedLink != null) && translatedLink.endsWith("/")) {
              translatedLink += "index.html";
          }
  
          // final check: if the translated link is still null the original link found
          // was broken
          // lets link it to the same page, the link is found on
          if (translatedLink == null) {
              translatedLink = "#";
          }
  
          return translatedLink;
      }
docs: Translated a link into the real file system to its new location in the OpenCms VFS.<p>
  
  This is needed by the HtmlConverter to get the correct links for link translation.<p>
  
  @param link link to the real file system
  
  @return string containing absolute link into the OpenCms VFS