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)); }
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); }
public IFolder CreateTempFolder(CmisPath path, bool recursive, IDictionary<string, object> properties) { path = path.WithoutTrailingSlash(); if (recursive) { try { return _cmisNav.GetFolder(path); } catch (CmisBaseException) {} } var comps = path.GetComponents(); if (recursive) { CreateTempFolder(comps[0], true, null); } var folder = _cmisNav.CreateFolder(path, false, properties); _createdObjects.Add(folder); return folder; }