public IFolder CreateFolder(CmisPath path, bool recursive,
IDictionary <string, object> properties)
{
path = path.WithoutTrailingSlash();
if (recursive)
{
// check if it already exists and proceed to create otherwise
try
{
return(GetFolder(path));
}
catch (CmisObjectNotFoundException)
{
}
}
var components = path.GetComponents();
var dirname = components[0];
var basename = components[1];
IFolder parent = recursive ? CreateFolder(dirname, true, null) : GetFolder(dirname);
var allProps = new Dictionary <string, object>()
{
{ PropertyIds.ObjectTypeId, "cmis:folder" },
{ PropertyIds.Name, basename }
};
Utilities.UpdateDictionary(allProps, properties);
return(parent.CreateFolder(allProps));
}