You are here

You are here

Create a Folder

The FolderCreate method to create a new folder in SpringCM.  The client should create a new SCMFolder object and must populate the parent folder Id and folder name at a minimum.  Other options such as description and the attribute groups to restrict in the folder can optionally be set.  The method will return an SCMFolder object that has been updated with the Id of the newly created folder.

The Save method may be used to create folders as well, specifying the CreateIfNew parameter as true.  This can be useful when creating multiple folders at once, however for single folder creation, it is recommended to use FolderCreate.
 

Vertical Tabs

c#
string parentFolderId = "<Target parent folder Id for the newly created folder>";
string folderName = "<Name of the new folder>";
 
SCMFolder newFolder = new SCMFolder {ParentFolderId = parentFolderId, Name = folderName};
newFolder = springCMService.FolderCreate(token, newFolder);
 
Console.WriteLine("New folder created with Id {0}",newFolder.Id);
java
String parentFolderId = "<Target parent folder Id for the newly created folder>";
String folderName = "<Name of the new folder>";
 
SCMFolder newFolder = new SCMFolder(); 
newFolder.setParentFolderId(parentFolderId);
newFolder.setName(folderName);
 
newFolder = springCMService.folderCreate(token, newFolder);
 
System.out.println("New folder created with Id: "+newFolder.getId());