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 IDocument CreateDocument(CmisPath path, ContentStream stream, IDictionary<string, object> properties) { var components = path.GetComponents(); var name = components[1]; if (name.Length == 0) { throw new CmisNameConstraintViolationException("The document name is empty."); } var folder = GetFolder(components[0]); var allProps = new Dictionary<string, object>() { { PropertyIds.ObjectTypeId, "cmis:document" }, { PropertyIds.Name, name } }; Utilities.UpdateDictionary(allProps, properties); return folder.CreateDocument(allProps, stream, VersioningState.Major); }
public IDocument CreateDocument(CmisPath path, ContentStream stream, IDictionary <string, object> properties) { var components = path.GetComponents(); var name = components[1]; if (name.Length == 0) { throw new CmisNameConstraintViolationException("The document name is empty."); } var folder = GetFolder(components[0]); var allProps = new Dictionary <string, object>() { { PropertyIds.ObjectTypeId, "cmis:document" }, { PropertyIds.Name, name } }; Utilities.UpdateDictionary(allProps, properties); return(folder.CreateDocument(allProps, stream, VersioningState.Major)); }
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; }