[opencms-dev] Synchronize Folders
cms_questioner
cms_questioner at gmx.de
Thu May 1 18:45:33 CEST 2014
Robert Weber <rw <at> clt.ag> writes:
>
>
> Hi List,does
> anybody know how to start the synchronisation of folders of RFS and VFS
> programmatically? Thanks.Cheers!Robert
>
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev
>
>
Hi Robert,
just check following snippet for orientation:
public void syncRFSandVFS(String rfsFolder, String vfsFolder, CmsObject
m_cms) throws CmsSynchronizeException, CmsException {
File rfsDir = new File(rfsFolder);
if (rfsDir.exists() && rfsDir.isDirectory() &&
m_cms.existsResource(vfsFolder)) {
// save what gets synchronized
CmsSynchronizeSettings syncSettings = new CmsSynchronizeSettings();
syncSettings.setDestinationPathInRfs(rfsFolder);
ArrayList sourceList = new ArrayList();
sourceList.add(vfsFolder);
syncSettings.setSourceListInVfs(sourceList);
syncSettings.setEnabled(true);
new CmsSynchronize(m_cms, syncSettings, new
CmsShellReport(m_cms.getRequestContext().getLocale()));
}
}
More information about the opencms-dev
mailing list