public bool ApplyAddedFolders(ref List<string> addedFolders)
{
bool success = true;
foreach (string addedFolder in addedFolders)
{
string destinationFolderPath = Path.GetDirectoryName(addedFolder);
SyncItem destinationFolderItem = SyncItemFactory.CreateFromLocalPath(destinationFolderPath, true, repoInfo, database);
SyncItem addedFolderItem = SyncItemFactory.CreateFromLocalPath(addedFolder, true, repoInfo, database);
try
{
IFolder destinationFolder = (IFolder)session.GetObjectByPath(destinationFolderItem.RemotePath);
IList<string> remoteFolders = new List<string>();
if (CmisUtils.FolderExists(session, addedFolderItem.RemotePath))
{
remoteFolders.Add(addedFolderItem.RemoteLeafname);
}
// TODO more efficient: first create said folder, then call CrawlSync in it.
CrawlSync(destinationFolder, destinationFolderItem.RemotePath, destinationFolderItem.LocalPath);
}
catch (Exception e)
{
Logger.Error("Error applying local folder addition to the server: " + addedFolder, e);
success = false;
}
}
return success;
}