You are here

You are here

Copy a Folder

The Copy method is used to copy any SCMBaseObject, including folders.  The method requires the object Id of the source folder and the target folder to copy to.  The result object includes both the source and new folder information that participated in the copy.  

Vertical Tabs

c#
string sourceFolderId = "<Source folder Id retrieved by other method calls>";
string targetParentFolderId = "<Target folder Id retrieved by other method calls>";
 
SCMCopyResults copyResults = springCMService.Copy(token, SCMObjectType.Folder, sourceFolderId, targetParentFolderId);
SCMFolderCopyResult folderCopyResult = copyResults.FolderResults[0];
 
Console.WriteLine("Copied source folder id {0} to target folder with id {1}.",
	folderCopyResult.SourceFolderId,folderCopyResult.NewFolderId);
java
string sourceFolderId = "<Source folder Id retrieved by other method calls>";
string targetParentFolderId = "<Target folder Id retrieved by other method calls>";
 
SCMCopyResults copyResults = springCMService.Copy(token, SCMObjectType.Folder, sourceFolderId, targetParentFolderId);
SCMFolderCopyResult folderCopyResult = copyResults.FolderResults[0];
 
Console.WriteLine("Copied source folder id {0} to target folder with id {1}.",
	folderCopyResult.SourceFolderId,folderCopyResult.NewFolderId);