SenseNet.ContentRepository.Tools.EnsureContainer C# (CSharp) Method

EnsureContainer() private static method

private static EnsureContainer ( string path, string containerTypeName ) : Content
path string
containerTypeName string
return Content
        private static Content EnsureContainer(string path, string containerTypeName)
        {
            if (Node.Exists(path))
                return null;

            var name = RepositoryPath.GetFileName(path);
            var parentPath = RepositoryPath.GetParentPath(path);

            //recursive call to create parent containers
            EnsureContainer(parentPath, containerTypeName);

            return CreateContent(parentPath, name, containerTypeName);
        }