Plumtree EDK (Enterprise Web Development Kit) 5.4.0 |

# IFolderManager.MoveFolder Method

Move all the objects of the source folder into the specified destination parent folder, including any content items, Data Entry Templates, Presentation Templates, selection lists, sub-folders and all objects in each sub-folder.

void MoveFolder(
IFolder sourceFolder,
IFolder destinationParentFolder
);

#### Parameters

sourceFolder
  The folder to move; cannot be `null` and has to be persisted prior to call.
destinationParentFolder
  The parent folder to move the folder into; cannot be `null` and has to be persisted prior to call.

#### Remarks

This method will attempt to move all the objects in the source folder in an atomic operation. If an error occurs while moving one of the objects, the move will stop and all changes will be rolled-back.

Prior to the call, both the source and destination folders have to be stored. A `ContentException` will be thrown if you move a folder to any of its subfolders.

Note: The `sourceFolder` will be refreshed with new values for its folder path and parent folder value, i.e. the parent folder will become the specified destination parent folder, and the folder path will become a sub-folder path in the desintation parent folder. Any existing instances of IFolder that refer to the `sourceFolder` prior to this move operation will need to be refreshed from the server.

#### Exceptions

Exception Type | Condition
--- | ---
InvalidOperationException | The source folder has not yet been stored or has been removed or the destination parent folder has not been stored or has been removed.
ContentSecurityException | The user does not have permission to access one of the folders.
ContentException | The method call resulted in a Content Server exception.
SoapException | There was a communication problem during the execution of the remote method call.

#### See Also

IFolderManager Interface | Plumtree.Remote.PRC.Content.Folder Namespace