public void adjustLinks ( String sourceFolder , String targetFolder ) throws CmsException { String rootSourceFolder = addSiteRoot ( sourceFolder ) ; String rootTargetFolder = addSiteRoot ( targetFolder ) ; String siteRoot = getRequestContext ( ) . getSiteRoot ( ) ; getRequestContext ( ) . setSiteRoot ( "" ) ; try { CmsLinkRewriter linkRewriter = new CmsLinkRewriter ( this , rootSourceFolder , rootTargetFolder ) ; linkRewriter . rewriteLinks ( ) ; } finally { getRequestContext ( ) . setSiteRoot ( siteRoot ) ; } }
Adjusts all links in the target folder that point to the source folder so that they are kept relative in the target folder where possible .