public void adjustLinks(List<String> sourceFiles, String targetParentFolder) throws CmsException {

        CmsObject cms = OpenCms.initCmsObject(this);
        cms.getRequestContext().setSiteRoot("");
        List<String> rootSourceFiles = new ArrayList<String>();
        for (String sourceFile : sourceFiles) {
            rootSourceFiles.add(addSiteRoot(sourceFile));
        }
        String rootTargetParentFolder = addSiteRoot(targetParentFolder);

        CmsLinkRewriter rewriter = new CmsLinkRewriter(cms, rootSourceFiles, rootTargetParentFolder);
        rewriter.rewriteLinks();
    }
public void adjustLinks ( List < String > sourceFiles , String targetParentFolder ) throws CmsException { CmsObject cms = OpenCms . initCmsObject ( this ) ; cms . getRequestContext ( ) . setSiteRoot ( "" ) ; List < String > rootSourceFiles = new ArrayList < String > ( ) ; for ( String sourceFile : sourceFiles ) { rootSourceFiles . add ( addSiteRoot ( sourceFile ) ) ; } String rootTargetParentFolder = addSiteRoot ( targetParentFolder ) ; CmsLinkRewriter rewriter = new CmsLinkRewriter ( cms , rootSourceFiles , rootTargetParentFolder ) ; rewriter . rewriteLinks ( ) ; }
This method works just like {@link CmsObject#adjustLinks(String, String)}, but you can specify multiple source
files, and the target folder is interpreted as the folder into which the source files have been copied.<p>

@param sourceFiles the list of source files
@param targetParentFolder the folder into which the source files have been copied

@throws CmsException if something goes wrong