private void hardTouch(CmsObject cms, CmsResource resource) throws CmsException {

        CmsFile file = cms.readFile(resource);
        cms = OpenCms.initCmsObject(cms);
        cms.getRequestContext().setAttribute(CmsXmlContent.AUTO_CORRECTION_ATTRIBUTE, Boolean.TRUE);
        file.setContents(file.getContents());
        cms.writeFile(file);
    }
private void hardTouch ( CmsObject cms , CmsResource resource ) throws CmsException { CmsFile file = cms . readFile ( resource ) ; cms = OpenCms . initCmsObject ( cms ) ; cms . getRequestContext ( ) . setAttribute ( CmsXmlContent . AUTO_CORRECTION_ATTRIBUTE , Boolean . TRUE ) ; file . setContents ( file . getContents ( ) ) ; cms . writeFile ( file ) ; }
Rewrites the content of the given file.<p>

@param cms the CmsObject
@param resource the resource to rewrite the content for

@throws CmsException if something goes wrong