[opencms-dev] Synchronize command in CmsShell
Stefan Uldum Grinsted
stefan at e-nation.dk
Fri Aug 18 14:08:02 CEST 2006
Hi there.
I've produced the following few, but quite useful lines of code for
org.opencms.main.CmsShellCommands allowing you to use the synchronize
functionality from the CmsShell. I was hoping it could become part of a
future OpenCMS release.
I created this in my build of OpenCMS 6_0_3, so I haven't created any patch,
but I assume that it would also work in the latest from head.
Here is the code:
/**
* This synchronizes an RFS folder with a number of VFS folders.
*
* @param rfsFolder the path to the folder in the "real" file system
* @param vfsFolders a semicolon separated list of VFS paths to
synchronize with
*
* @throws CmsSynchronizeException
* @throws CmsException
*/
public void synchronize(String rfsFolder, String vfsFolders) throws
CmsSynchronizeException, CmsException {
CmsSynchronizeSettings settings = new CmsSynchronizeSettings();
settings.setDestinationPathInRfs(rfsFolder);
settings.setEnabled(true);
String[] folders = vfsFolders.split(";");
settings.setSourceListInVfs(Arrays.asList(folders));
new CmsSynchronize(m_cms, settings, new
CmsShellReport(m_cms.getRequestContext().getLocale()));
}
Regards
Stefan Uldum Grinsted
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20060818/ea27e044/attachment.htm>
More information about the opencms-dev
mailing list