public function renameFolder(Folder $folder, $newTitle)
	{
		$entityManager = $this->getDoctrineEntityManager();
		$entityManager->beginTransaction();
		$oldFolder = clone($folder);
		$entityManager->detach($oldFolder);

		try {
			$folder->setFileName($newTitle);

			// validating folder before renaming
			foreach ($this->folderUploadFilters as $filter) {
				$filter->validateFolder($folder);
			}

			$entityManager->flush();

			// rename folder in both file storages
			$this->renameFolderInFileSystem($oldFolder, $folder);
		} catch (\Exception $e) {
			$entityManager->detach($folder);
			$entityManager->rollback();

			throw $e;
		}

		$entityManager->commit();
	}